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

Use the same condition for checking if SSR in useSelector.js as in connectAdvanced.js #1419

Merged
merged 1 commit into from
Oct 8, 2019

Conversation

LeoDanielsson
Copy link
Contributor

In connectAdvanced.js, window.document.createElement is checked to determine whether the code is running server side. In useSelector only window !== undefined is checked.

Many projects polyfill window on the server, which causes the useLayoutEffect warning when using useSelector. Changing to the more specific condition fixes this.

@netlify
Copy link

netlify bot commented Oct 8, 2019

Deploy preview for react-redux-docs ready!

Built with commit 94bd771

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

@timdorr
Copy link
Member

timdorr commented Oct 8, 2019

Thanks!

@timdorr timdorr merged commit 69d62e4 into reduxjs:master Oct 8, 2019
webguru7 pushed a commit to webguru7/react-redux that referenced this pull request Dec 8, 2022
aungkoman pushed a commit to ReactJSMyanmar/react-redux that referenced this pull request Dec 28, 2023
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.

2 participants