Next.js Discord

Discord Forum

Why use className={styles.main}?

Answered
Pyramid ant posted this in #help-forum
Open in Discord
Avatar
Pyramid antOP
why not just say className="main" instead of className={styles.main}?
Answered by risky
if you use .module.css, then it makes fancy class names to be used safer (ie no duplicate)... but if you just import normal .css then you can use the first option
View full answer

1 Reply

Avatar
if you use .module.css, then it makes fancy class names to be used safer (ie no duplicate)... but if you just import normal .css then you can use the first option
Answer