File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1+ /* eslint-disable react-hooks/exhaustive-deps */
2+ import { useEffect , useLayoutEffect } from "react" ;
3+
4+ const isBrowser = typeof window !== "undefined" ;
5+ const effect = isBrowser ? useEffect : useLayoutEffect ;
6+
7+ export const useIsomorphicEffect = effect ;
Original file line number Diff line number Diff line change 33export * from "./hooks/use-force-update.hook" ;
44export * from "./hooks/use-will-mount.hook" ;
55export * from "./hooks/use-did-mount.hook" ;
6- export * from "./hooks/use-did-render .hook" ;
6+ export * from "./hooks/use-did-change .hook" ;
77export * from "./hooks/use-did-update.hook" ;
88export * from "./hooks/use-will-unmount.hook" ;
99export * from "./hooks/use-is-mounted.hook" ;
10+ export * from "./hooks/use-isomorphic-effect.hook" ;
You can’t perform that action at this time.
0 commit comments