import { useEffect, useRef } from 'react'; export const useUpdateEffect: typeof useEffect = (effect, deps) => { const isInitialMount = useRef(true); useEffect(() => { if (isInitialMount.current) { isInitialMount.current = false; } else { return effect(); } // eslint-disable-next-line react-hooks/exhaustive-deps }, deps); };