[Portal] Hydration failure in SSR when initially rendered
See original GitHub issueThis manifests itself in Dialog and AlertDialog when using Portal with DefaultOpen in SSR env.
https://codesandbox.io/s/friendly-morning-3ny0r5?file=/pages/index.tsx
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:6
Top Results From Across the Web
react-hydration-error - Next.js
When css-in-js libraries are not set up for pre-rendering (SSR/SSG) it will often lead to a hydration mismatch. In general this means the...
Read more >React 18: Hydration failed because the initial UI does not ...
Hydration failed because the initial UI does not match what was rendered on the server. Live demo code is here. Live demo of...
Read more >Handling the React server hydration mismatch error
The ideal fix would be for us to determine from React that the initial render of the component is actually the hydration render....
Read more >The Perils of Rehydration - Josh W Comeau
Server-side rendering 101. To understand the problem, we need to first dig a little into how frameworks like Gatsby and Next.js differ from ......
Read more >Understand and solve hydration errors in Vue.js - sum.cumo
If a component is initially mounted or hydrated in the DOM, it needs to precisely correspond to the HTML generated on the server...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The same issue here when working with next.js, any plan to fix this? Now my workaround is set the
opentofalsedefault, then set ittrueinuseEffectwhen page has mounted.Not directly, no. The server has no concept of screen media size until it hits the client which is why is falls into the
falseblock on server and hydratestrueon desktop which reports a mismatch.