DEV Community

Discussion on: Less annoying CSS in React with CSS modules

Collapse
 
pcjmfranken profile image
Peter Franken

FYI This does not just work out of the box, it requires a compiler with the right configuration. Perhaps you could add some setup instructions to the post, or at least mention this prerequisite.

Other than that, yeah, CSS Modules are awesome! Very performant, easy to work with, and with the right compiler config you could even use SASS.

Collapse
 
fawazsullia profile image
fawazsullia

Thanks for the suggestions man. I'll add it there.

Collapse
 
fawazsullia profile image
fawazsullia

I guess the compiler is included in webpack

Thread Thread
 
pcjmfranken profile image
Peter Franken

Yes through css-loader likely. What platform (e.g. Create React App / Next.js / Nuxt / etc.) would you usually use as a base if you don't mind me asking?

Thread Thread
 
fawazsullia profile image
fawazsullia

Create react app mostly. Sometimes Gatsby.