Describe the bug In my React Typescript project, I am trying to use CSS modules. I created the project using create-react-app , added TypeScript later. Then I followed the instructions from the docs to setup CSS modules in the project
npm install -D typescript-plugin-css-modules
{
"compilerOptions": {
"plugins": [{ "name": "typescript-plugin-css-modules" }]
}
}
To Reproduce
Expected behavior Home link color should be white
Since you already solved the issue, please have a look for description: problem in accessing the scss variables in react components
in a similar way you can access classes from the module scss files.
Never mind, changing the name of the scss file to header.module.scss fixed the issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.