fix: layout effect hook warning (#9226)
* feat: add isomorphic hook * feat: use useIsomorphicLayoutEffect hook
This commit is contained in:
1 parent
60d439cc32
commit
268f1872e4
2 files changed
+34
-30
No files matched your search
@@ -0,0 +1,3 @@
|
||||
import { useEffect, useLayoutEffect } from "react";
|
||||
|
||||
export const useIsomorphicLayoutEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect;
|
||||
Reference in new issue
Block a user