flex gap feature detection causes style prop mismatch warning with server-side rendering
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Steps to reproduce
- enable gutters > 0
- use a framework with server-side rendering like Next.js
- create a Row or Col component
What is expected?
no warnings in console
What is actually happening?
Warning: Prop `style` did not match. Server: "null" Client: "--column-gap:0px;--row-gap:0px"
at div
at Row
Environment | Info |
---|---|
antd | 4.12.3 |
React | 16.13.1 |
System | n/a |
Browser | any with flex-gap support |
This appears to be caused by the feature detection function detectFlexGapSupported in _util/styleChecker. It returns false when running during server-side rendering, but returns true in modern browsers on the client side.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:23
- Comments:6
Top Results From Across the Web
flex gap feature detection causes style prop mismatch warning with ...
This appears to be caused by the feature detection function detectFlexGapSupported in _util/styleChecker. It returns false when running during server-side ...
Read more >How to detect browser support for Flexbox Gap
The gap property is an attempt to have the same property for CSS grid and flexbox. It will be responsible for the spacing...
Read more >React + Material-UI - Warning: Prop className did not match
I'm having difficulty with differences between client-side and server-side rendering of styles in Material-UI ...
Read more >Safari Technology Preview Release Notes - Apple Developer
Added emulation toggles for prefers-reduced-motion and prefers-contrast CSS media features (257197@main); Fixed corrupted styles when adding a new property ...
Read more >Releases - Pandoc
Org template: add abstract from metadata as block of type “abstract” (#8204). HTML writer: use flex property for column widths (Albert Krewinkel, #8232)....
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
Have the same issue using antd with next.js
I guess it’s should to be reopen.
"antd": "^4.13.0",
"next": "^10.0.7",
Vertical gutter works fine in dev now, but not in production. I have static prerender pages (getStaticPaths + getStaticProps) in Next.js and after build there is no vertical space.
Also error
Warning: Prop style did not match. Server: "null" Client: "row-gap:0" at div
still in development mode