Answer the question
In order to leave comments, you need to log in
How in React Modules Stylesheet to use with your styles?
For example, I have a block
<div className="nav df fdc">
</div>
<div className=`{st.nav} df fdc`>
</div>
Answer the question
In order to leave comments, you need to log in
Global classes are usually exposed globally, for example in index.css and connected, for example, in index.js as:
import './index.css'
And CSS modules are stored next to the component code and the files themselves are named with the module suffix, for example Header.module.css. CSS modules are connected in the components themselves like this:
import styles from './Header.module.css'
And they are used like this:
<div className={`${styles.header} global-class-1 global-class-2`}></div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question