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 }; |
\ | No newline at end of file |