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

Getting warning when used with ssr #8

Closed
astroanu opened this issue Nov 26, 2020 · 2 comments
Closed

Getting warning when used with ssr #8

astroanu opened this issue Nov 26, 2020 · 2 comments

Comments

@astroanu
Copy link

astroanu commented Nov 26, 2020

I'm using this with next js and the following is being printed to the console

Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.

Any idea how to remove this?

@szhsin
Copy link
Owner

szhsin commented Nov 29, 2020

Hi @astroanu ,

I released a patch in v1.0.3 which should get around the warning.

For more details about this issue, please see #14927.

You might find this comment useful when testing with Jest.

@astroanu
Copy link
Author

Thank you. it's working great!

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

No branches or pull requests

2 participants