An S-shaped road, inside a forest.

Conditional classes with classnames

I’m not a React expert but I’ve been working with the framework in the last few months and I have to say that classnames is something that helps you a lot.

Code is better than words. So, I used to do something like this


It works… but thinking about the possibility of the number of CSS classes start to increase, this approach wouldn’t be good enough. So, I found out this magic called classnames.

See all posts...