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

avoid warning in ssr #35

Merged
merged 3 commits into from Nov 28, 2019
Merged

avoid warning in ssr #35

merged 3 commits into from Nov 28, 2019

Conversation

dai-shi
Copy link
Owner

@dai-shi dai-shi commented Nov 28, 2019

The use of useLayoutEffect shows warning in SSR. facebook/react#14927

This is an easy fix. It doesn't help if window is polyfilled.
(But, currently I don't feel like using a complex hack like https://github.com/alloc/react-layout-effect.)

Originally reported by @alvinthen in #33 (comment).

@dai-shi
Copy link
Owner Author

dai-shi commented Nov 28, 2019

On a second thought, we don't need to useLayoutEffect if we modify dispatchRef in render. That should be more stable.

@dai-shi dai-shi merged commit e0a61bc into master Nov 28, 2019
@dai-shi dai-shi deleted the avoid-warning-in-ssr branch November 28, 2019 09:03
@dai-shi
Copy link
Owner Author

dai-shi commented Nov 28, 2019

https://www.npmjs.com/package/react-hooks-async/v/3.8.1

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

1 participant