We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0ace17 commit a1fa7ffCopy full SHA for a1fa7ff
src/hooks/use-isomorphic-effect.hook.ts
@@ -0,0 +1,7 @@
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;
src/index.ts
@@ -3,7 +3,8 @@
export * from "./hooks/use-force-update.hook";
export * from "./hooks/use-will-mount.hook";
export * from "./hooks/use-did-mount.hook";
-export * from "./hooks/use-did-render.hook";
+export * from "./hooks/use-did-change.hook";
export * from "./hooks/use-did-update.hook";
8
export * from "./hooks/use-will-unmount.hook";
9
export * from "./hooks/use-is-mounted.hook";
10
+export * from "./hooks/use-isomorphic-effect.hook";
0 commit comments