DEV Community

Discussion on: Project 41 of 100 - Writing Responsive CSS in JSX

 
betoshiver profile image
Alberto Shiver

Yes, there is an easy way, you can do CSS modules, (styles.module.css) that way it'll only take the styles from the specified module even if another module had the same class name.

When you declare a className on a jsx component it goes like this example:

className ={module1.btn}

It'll only apply the styles for btn that are declared on the module1 module