In CSS modules, CSS class names and animation names are scoped locally by default. In React you can use the file naming conversion as [file name].module.css
. This let the React and Webpack know that you are using CSS Modules.
Importing the CSS in the file.
import nameyoulike from './name.modules.css';
Calling the style in the file.
<button className={styles.button} />
What are your thoughts on this post?
I’d love to hear from you! Click this link to email me—I reply to every message!
Also use the share button below if you liked this post. It makes me smile, when I see it.