Safari and ios bug with Next.js: Warning: Prop `className` did not match. Server: ...
See original GitHub issueSafari and ios bug: Warning: Prop className
did not match. Server: …
This is very strange, the page performs well on chrome, but on Safari and all browsers (even chrome) under ios have lost some css.
The error message is:Warning: Prop className
did not match. Server: …
Expected Behavior 🤔
ios platfrom and safari work success.
Current Behavior 😯
on Chrome:
on Safafi:
Env
macOS: mojava nextjs: latest material-ui: latest
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Safari and ios bug with Next.js: Warning: Prop className did ...
Safari and ios bug: Warning: Prop className did not match. Server: ... This is very strange, the page performs well on chrome, but...
Read more >React + Material-UI - Warning: Prop className did not match
The problem is the SSR rendering in Next.js, which produces the style fragment before the page is rendered. Using Material UI and Next.js...
Read more >styled components not working in prod nextjs - You.com
The example works out of the box. However, once you create a styled-component, the className did not match from server side rendering error...
Read more >Fixing ClassName did not match error - DEV Community
Warning : Prop `className` did not match. Server: Client: This is probably one of the most annoying problem with ...
Read more >“react does not recognize styled components props” Code ...
Queries related to “react does not recognize styled components props” · styled components next js · Prop `className` did not match · styled ......
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
Just had this issue and I can confirm it was due to duplicate property names in my style object (passed to
makeStyles
) as mentioned by @kof .I didn’t notice it easily because I had many different properties:
Not sure why this happens, but on Safari, it looks like the duplicate property increments the jss numbering, making every style number off by one (.jss1 becomes .jss2 and so on). This completely breaks the style of the component.
@jimmiebtlr Have a look at our next.js examples. They should be free from this issue.