Css 有反应的模块

Css module with react

我正在构建一个 React 网站,以启用 css 模块样式 我弹出我使用的项目

npm run eject

并且我在 webpack.config.dev.js 和 webpack.config.prod.js 文件中添加了额外的配置,问题是我正在使用组件调用 react-big-calendar (https://github.com/intljusticemission/react-big-calendar), and in that module I have to import a css file. The problem is that when I enable the module features it doesn't apply the css styles to the calendar, It used to look like:

现在看起来像这样:

如何从大日历 css 文件应用 类?

谢谢!

现在您不必退出项目并向 webpack.config 添加额外的配置来启用 css 模块。 现在,只要您想使用 css 模块,只需将文件命名为 [name].module.css 即可。这将解决未使用 css 模块的组件的问题。

让我知道它是否适合你