1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,9 +0,0 @@ |
1 |
-import { useEffect, useLayoutEffect } from 'react'; |
|
2 |
- |
|
3 |
-function useIsomorphicLayoutEffect(callback, deps) { |
|
4 |
- // eslint-disable-next-line |
|
5 |
- if (typeof window === 'undefined') return useEffect(callback, deps); |
|
6 |
- return useLayoutEffect(callback, deps); |
|
7 |
-} |
|
8 |
- |
|
9 |
-export { useIsomorphicLayoutEffect }; |
|
10 | 0 |
\ No newline at end of file |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,9 @@ |
1 |
+import { useEffect, useLayoutEffect } from 'react'; |
|
2 |
+ |
|
3 |
+function useIsomorphicLayoutEffect(callback, deps) { |
|
4 |
+ // eslint-disable-next-line |
|
5 |
+ if (typeof window === 'undefined') return useEffect(callback, deps); |
|
6 |
+ return useLayoutEffect(callback, deps); |
|
7 |
+} |
|
8 |
+ |
|
9 |
+export { useIsomorphicLayoutEffect }; |
|
0 | 10 |
\ No newline at end of file |