useIsomorphicLayoutEffectHook conditionally selects either `useLayoutEffect` or `useEffect` based on the environment