diff --git a/lib/hooks/isomorphic-layout-effect.react.js b/lib/hooks/isomorphic-layout-effect.react.js new file mode 100644 index 000000000..5cc8b32ee --- /dev/null +++ b/lib/hooks/isomorphic-layout-effect.react.js @@ -0,0 +1,6 @@ +// @flow + +import * as React from 'react'; + +export const useIsomorphicLayoutEffect: typeof React.useEffect = + typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;