diff --git a/src/hooks/useSelector.js b/src/hooks/useSelector.js index 2b88b16d1..4cc15432b 100644 --- a/src/hooks/useSelector.js +++ b/src/hooks/useSelector.js @@ -20,7 +20,11 @@ import { ReactReduxContext } from '../components/Context' // is created synchronously, otherwise a store update may occur before the // subscription is created and an inconsistent state may be observed const useIsomorphicLayoutEffect = - typeof window !== 'undefined' ? useLayoutEffect : useEffect + typeof window !== 'undefined' && + typeof window.document !== 'undefined' && + typeof window.document.createElement !== 'undefined' + ? useLayoutEffect + : useEffect const refEquality = (a, b) => a === b