import { useEffect , useRef } from 'react' ; /**
 * useUpdateEffect hook
 *
 * Run an effect only on updates.
 * Skip the first effect execution that occurrs after initial mount.
 */ const useUpdateEffect = ( effect , deps ) : void => { const isFirstRender = useRef < boolean > ( true ) ; useEffect ( ( ) => { if ( isFirstRender . current ) { isFirstRender . current = false ; } else { return effect ( ) ; } } , deps ) ; } ; export default useUpdateEffect ;