Classnames. So where you may have the following code to generate a className prop for a. Installing and importing classnames. The novelty of tiny NPM packages. Functional typed classnames for TailwindCSS.
Classnames library lets you join different classes based on different conditions in a simpler way. There is so much you can do with this. One name Ive seen used quite a bit is cx. So where you may have the following code to generate a className prop for a. So you could import it like this. The novelty of tiny NPM packages.
Suppose you have 2 classes of which one is going to get used every time but the second one gets used based on some condition.
1 import cx from classnames. The classNames function takes any number of arguments which can be a string or object. This package is the official replacement for classSet which was originally shipped in the Reactjs Addons bundle. So without classnames library you would something like this. Not only can you use props to conditionally apply class names but you can. The novelty of tiny NPM packages.