When no classes are selected, classNames should return null
Author: Lovor01Created Jul 15, 2023Updated Dec 28, 2023
Labelsfeaturebreaking change
ClassNames with no classes selected return empty string (''). For using it in React with jsx, it would be much better to return null.
Example:
<p className={classNames({ first: false, second: false)>
Hello World!
</p>This results in <p class>Hello World!</p>, while <p>Hello World!</p> would be correct. The second would happen if classNames returned null in such case.
Source: JedWatson/classnames