vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.95k stars 26.87k forks source link

I'm using Next.js 14. , and I've added to next.config.mjs #61547

Open Yondo202 opened 8 months ago

Yondo202 commented 8 months ago
          I'm using Next.js 13.0.3 beta, and I've added to next.config.js:
compiler: {
    styledComponents: true,
  },

However, when my own client-side JavaScript adds classes to elements, I'm getting the warning "Prop "className" did not match. Server: "<myclass, etc.>"

How do I prevent this warning? I do want to use ssr and rust, and I need to add classes to elements in the client, classes that are not present on the component expressed in the server-side JSX. Adding styledComponents: true is not fixing it.

Originally posted by @tmb-github in https://github.com/vercel/next.js/issues/30802#issuecomment-1312570191

CharlesSAUVAT commented 8 months ago

+1

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!