import { DependencyList , EffectCallback , useEffect , useRef } from "react" ; see https export const useDidUpdateEffect = ( fn , inputs ? ) : void => { const didMountRef = useRef ( false ) ; return useEffect ( ( ) => { if ( didMountRef . current ) fn ( ) ; else didMountRef . current = true ; } , [ inputs , fn ] ) ; } ;