Reputation: 677
Currently, in React I write my css in css modules. However, I also use the font-awesome library which uses normal css.
So my question is there is a way to use a normal css and css module on the same selector?
<i className={classes.icon} + "far fa-user" />
Upvotes: 0
Views: 549
Reputation: 3775
Thanks to ES6 syntax, you can write it like this:
<i className={`${classes.icon} far fa-user`} />
Upvotes: 3
Reputation: 167182
If you completely understand how React works, you will be putting it this way:
<i className={classes.icon + " far fa-user"} />
The classes.icon
will be the className
string and along with it, you have to add other classes.
Upvotes: 2