Answer the question
In order to leave comments, you need to log in
How to correctly specify classes when using module.css?
When using module css, you need to add styles to the class, but what if I use hooks?
For example, there is a code.
How can I use the modal, active classes with the module.css approach (styles.modal and styles.active) or nothing can be done in this case and I have to put the classes in the global css file?
className={active ? "modal active" : "modal"}
Answer the question
In order to leave comments, you need to log in
className={active ? styles.modal + ` ` + styles.active : styles.modal}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question