Next.js Warning: Prop className did not match

问题

解决办法

  • Create a file named .babelrc in the root directory and configure the .babelrc file.
  • delete the .next build folder(It stores some caches).
  • Restart the server.
  • Hot reload the browser.

.babelrc configuration file

{
    "presets": [
        "next/babel"
    ],
    "plugins": [
        [
            "styled-components",
            {
                "ssr": true,
                "displayName": true,
                "preprocess": false
            }
        ]
    ]
}
暂无评论

发送评论 编辑评论


				
上一篇
下一篇