Skip to content
Discussion options

You must be logged in to vote

<p className={styles.error}>hey</p>

However with that I cannot do a class concatenation... That's why i want to use css files like react !

You can! These values are just strings, you can concanate them:

<p className={styles.error + ' ' + styles.foo}>hey</p>
// or with template strings
<p className={`${styles.error} ${styles.foo}`}>hey</p>

To make things easier you can use a package like classnames:

<p className={cx(styles.error, styles.foo)}>hey</p>

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@CMonjo
Comment options

Comment options

You must be logged in to vote
2 replies
@CMonjo
Comment options

@sambhav-gore
Comment options

Comment options

You must be logged in to vote
3 replies
@CMonjo
Comment options

@rafaelalmeidatk
Comment options

@CMonjo
Comment options

Answer selected by CMonjo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants