3 ms·
Readability is important, your example above would need to be classNames({ mainClass: true, [props.className]: props.className, otherClass: someP
by city41 8y ago
Readability is important, your example above would need to be
classNames({
mainClass: true,
[props.className]: props.className,
otherClass: somePredicate
})
The props.className one in particular is pretty garish. Probably should do !!props.className to help explain intent a bit, which adds to the tedium. Once you've added falsy thinning and arbitrary arguments, you're 99% of the way to classnames.