NavigationDrawer with `mobileDrawerType` or `drawerType` results in invalid checksum with Server-Side Rendering
See original GitHub issueDescription
I am using Next.js, which offers SSR (server-side rendering) out of the box. Recently, I bumped into an issue when passing mobileDrawerType
or drawerType
I get:
Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
(client) ton></div></header><!-- react-empty: 15
(server) ton></div></header><span data-reactid="1
Everything works fine, but React throws everything away instead of just connecting to existing DOM.
Using only tabletDrawerType
and desktopDrawerType
doesn’t raise the warning. Also, drawerType
of non *_MINI
work fine. I guess that SSR may get detected and rendered as a mobile version, but later on the client side, it turns out to be a desktop.
Link to a gist or code sample where the issue can be reproduced
https://github.com/zeit/next.js/tree/master/examples/with-react-md
Version
- React 15.4.2
- React-MD 1.0.2
- Next.JS 2.0.0.beta20
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
[NavigationDrawer] - Invalid Checksums from Server-Side ... - GitHub
mlaursen changed the title NavigationDrawer with *_MINI drawerType results in invalid checksum with Server-Side Rendering [NavigationDrawer] - Invalid ...
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
Sadly, not yet. It might be a week before it is in a more stable state for a “beta”. I believe there is currently an alpha out that has this fix in it, but upgrading to alpha might be a bad idea 😃
I’m about 2-3 days away from finishing #145 which will be one of the last more “app-changer” tickets since it modified menus and components that used menus so much. I’ll do some more issue pruning/thoughts and figure out if anything might be terrible for migrating and publish a beta then. The SVGIcon (#253) and Fixed Table Header/Footer (#197) might be considered an app changer which might delay the beta. Otherwise, it seems like the other issues are more behind-the-scenes/no-changes-required/new-features sort of things.
This has been fixed with #230