[英]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.