Closed vladshcherbin closed 5 years ago
@vladshcherbin Can <div class=""/>
break an app?
Hyperapp's output is: <div class />
by the way.
@jorgebucaran I don't think it can break an app.
Returning undefined
just gives a clean html output without empty classes.
@vladshcherbin Return undefined
and you may also end up with "undefined my-class"
if you're concatenating Classcat's output with a string as someone already pointed out in the classNames PR.
React, Hyperapp should solve this, not Classcat. I want a clean DOM too, but changing Classcat to monkey-patch a JavaScript framework is worse.
I'll fix this in Hyperapp in https://github.com/jorgebucaran/hyperapp/issues/754.
Thanks! 👋
@jorgebucaran sure, thanks :)
Same as https://github.com/JedWatson/classnames/issues/182
In react, if the value passed to
className
is an empty string, the html output will be<div class=""/>
. In order to have a clean<div />
,undefined
should be passed.Any idea how this can be solved? There is a PR in
classnames
, what do you think about this inclasscat
? :)