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

Warning: Did not expect server HTML to contain a <div> in <div>. in nextjs React-17 ssr. #59

Open
kmvan opened this issue Dec 17, 2020 · 5 comments
Assignees

Comments

@kmvan
Copy link

kmvan commented Dec 17, 2020

Describe the bug
Warning: Did not expect server HTML to contain a <div> in <div>. in nextjs React-17 ssr.

⚠️ Make a Codesandbox ⚠️
https://codesandbox.io/s/useportal-in-nextjs-codesandbox-container-forked-oh10i?file=/pages/index.js

To Reproduce
Run the sandbox and console shows warning message.
image

Expected behavior
No warning message

@alex-cory
Copy link
Owner

I was wondering what was causing this. I will def take a look asap. Bare with me, things are kind of crazy for me right now.

@YCMitch
Copy link

YCMitch commented Jun 16, 2021

Guess we never resolved this one? I'm getting it too.

@alex-cory
Copy link
Owner

Happy to accept a PR.

@YCMitch
Copy link

YCMitch commented Jun 18, 2021

I just sorted it out by rendering null on the server and only rendering the portal on the client.

@kmvan
Copy link
Author

kmvan commented Mar 19, 2022

I just sorted it out by rendering null on the server and only rendering the portal on the client.

Same.

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

3 participants