Closed felixmosh closed 2 years ago
Hey thanks,
no this is intentional as clsx is meant to be a 1:1 drop in replacement for the classnames package, which has been heavily utilized by the react ecosystem for years. Plus if you really want to hide the attr, you can wrap the library as your own utility:
import clsx from 'clsx';
export default function () {
return clsx.apply(0, arguments) || undefined;
}
Hope that helps!
Hi,
First of all thank you for this awesome package 🙏🏼.
I've noticed that when the calculation of clsx returning an empty string, React renders an empty
class
attribute.A working example: https://codesandbox.io/s/clsx-empty-string-bug-rrqu40
Should I make a PR for returning
undefined
in case of an empty string?