mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 18:26:38 -04:00
Migrate to app router (#2254)
This commit is contained in:
@ -1,15 +0,0 @@
|
||||
import { useEffect } from "react";
|
||||
import useFirstMountState from "./useFirstMountState";
|
||||
|
||||
// identical to `useEffect()` but ignores the first invocation
|
||||
const useUpdateEffect: typeof useEffect = (effect, deps) => {
|
||||
const isFirstMount = useFirstMountState();
|
||||
|
||||
useEffect(() => {
|
||||
if (!isFirstMount) {
|
||||
return effect();
|
||||
}
|
||||
}, deps); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
};
|
||||
|
||||
export default useUpdateEffect;
|
Reference in New Issue
Block a user