CSS class selector styles not being applied in React Project

前端 未结 4 2048
鱼传尺愫
鱼传尺愫 2021-01-13 07:52

Working on a React project using Webpack. Adding some styles in style.css and importing into component with import style from \'./style.css\';. Elements without

4条回答
  •  一向
    一向 (楼主)
    2021-01-13 08:27

    While Kyle's answer works, a better solution would be to rename the css file as style.global.css and import it with import './style.global.css' and specify the class name like normal html. this works better for when you want to append different class names at run time

    foo div

提交回复
热议问题