When upgrading the Next version from 12 to 13 I got the error "Warning: Prop className
did not match." pointing to styled-components. My initial setup was with babel, including babel-plugin-styled-components
, but when I stumbled across this thread I decided to try out SWC. My understanding was that it should solve my error, by following these steps. I have:
- Removed the file .babelrc to let SWC be the default compiler
- Added to the next.config.js file
compiler: {
styledComponents: true
}
I also tried removing the babel-plugin-styled-components
dependency and installed swc-loader
, but I don't think that made any difference. How can I make sure that SWC is running (I guess it is), and how can I resolve the error (preferably by using SWC instead of Babel)?