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 useLayoutEffect wairning in ssr #756

Closed
wdh2100 opened this issue Jan 11, 2023 · 2 comments
Closed

Avoid useLayoutEffect wairning in ssr #756

wdh2100 opened this issue Jan 11, 2023 · 2 comments

Comments

@wdh2100
Copy link
Contributor

wdh2100 commented Jan 11, 2023

Version
Latest ^6.0.0

Steps to reproduce
Using the library on NextJS

Expected Behavior
Avoid useLayoutEffect wairning

Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output form
..

ref :

@ericgio
Copy link
Owner

ericgio commented Jan 11, 2023

Hi @wdh2100, thanks for opening this issue. As mentioned in #753, the library doesn't know if it's being rendered on the client or the server. You can probably just ignore the warning, but if you really want to suppress it, you can render a fallback UI while rendering on the server.

@ericgio ericgio closed this as completed Jan 11, 2023
@wdh2100
Copy link
Contributor Author

wdh2100 commented Jan 11, 2023

Hi @wdh2100, thanks for opening this issue. As mentioned in #753, the library doesn't know if it's being rendered on the client or the server. You can probably just ignore the warning, but if you really want to suppress it, you can render a fallback UI while rendering on the server.

@ericgio Thanks reply

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

No branches or pull requests

2 participants