fix: layout effect hook warning (#9226)

* feat: add isomorphic hook

* feat: use useIsomorphicLayoutEffect hook
This commit is contained in:
Nafees Nazik authored and GitHub committed 2023-06-01 09:45:24 +00:00
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;