Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support server rendering with window polyfill #1283

Merged
merged 1 commit into from May 13, 2019

Conversation

tobhult
Copy link
Contributor

@tobhult tobhult commented May 13, 2019

React warns about using useLayoutEffect during server rendering if window has been polyfilled since only the existence of window is checked in connectAdvanced.js

I suggest using the same check that React has in ExecutionEnvironment.js.

@netlify
Copy link

netlify bot commented May 13, 2019

Deploy preview for react-redux-docs ready!

Built with commit 7ac0442

https://deploy-preview-1283--react-redux-docs.netlify.com

@timdorr
Copy link
Member

timdorr commented May 13, 2019

Thanks!

@timdorr timdorr merged commit dcf2cb0 into reduxjs:master May 13, 2019
@markerikson
Copy link
Contributor

Ooooo, nice! Thanks!

@javache
Copy link

javache commented Sep 10, 2019

Is this logic correct when using react-redux in React Native? window.document and window.document.createElement do not exist there but we should still use useLayoutEffect.

It's also inconsistent with the useIsomorphicLayoutEffect logic in useSelector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants