[英]Modular CSS Styles not working
我已经使用create-react-app
创建了样板react create-react-app
。
现在,在我的App.js
文件中
import classes from './App.css';
我做到了
<div className={classes.App}>
<Cockpit
showPersons = {this.state.showPersons}
persons = {this.state.persons}
/>
{persons}
</div>
但是这些syles并没有得到应用。
我的App.css
看起来很基础。
.App {
text-align: center;
}
我的控制台中没有错误。 我也看不到任何webpack module config
文件。
我究竟做错了什么?
我发现了错误。 要在react中使用模块化CSS样式,您需要弹出webpack配置设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.