const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;