React : CSS class name import not working

后端 未结 15 1516
轻奢々
轻奢々 2020-12-31 20:16

i have a

div in my react component and im importing some class name from a class css file, but the class name is not getting integrated to the main
15条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 20:43

    If you're using Windows, don't name file 'Aux' it's reserved name.

    Solution is just to name your CSS files as (in your case) Layout.module.css and then import them as such.

    You don't need to eject as from the Create React App 2.0 since it uses CSS Modules out of the box.

提交回复
热议问题