After run build script, docbox css broken
nubilfi opened this issue · 5 comments
Hi,
I'm new to docbox and i have a little problem. Every time i run npm run build
script it always ends up with a broken CSS, i'm using the default provided CSS, and when i inspect it, i got this error:
Warning: Prop
className did not match. Server: "fixed-top fixed-right space-left16" Client: "fixed-top fixed-right undefined"
🤔 Okay - well, for now it should be fine to ignore the warning because React re-renders that portion of the DOM correctly. The issue is due to that extra class - space-left16
- being derived from a media query that doesn't run on the server (the static build process) but does run in the client. Not sure how to resolve that cleanly - open to suggestions.
I decided to use react v15 to build it, and it works, no CSS issue anymore.
Also, I found that revert the index.html file can solve this problem.
This would be a great opportunity for someone to help and fix and contribute a PR! I'd love to review and merge such a PR.
Can confirm that changing package.json
"react": "~15.6.2",
"react-dom": "~15.6.2",
resolves the build issue for me.