loading...

Discussion on: Two CSS Styling Options in React

Collapse
shadowtime2000 profile image
shadowtime2000

There are some more options other than these. Vercel's styled-jsx makes it a lot easier to avoid styling every component you use and css-modules allow you to do something like this:

import styles from './styles.module.css';

function Component(props) {
    return (
        <div className={styles.thisComponent}>
            <h1 className={styles.title}>Title</h1>
        </div>
    );
}
Enter fullscreen mode Exit fullscreen mode
Collapse
rwparrish profile image
rwparrish Author

I'll have to look into this. Thanks for taking the time to share!