3 ms·
Another advantage of camelCase is that classNames (https://github.com/JedWatson/classnames https://github.com/JedWatson/classnames) works without quoting:
by stickfigure 5y ago
Another advantage of camelCase is that classNames (https://github.com/JedWatson/classnames https://github.com/JedWatson/classnames) works without quoting:
// you have a variable isFoo
<SomeComponent className={classNames({isFoo})} />
is a lot better than:
// you have a variable isFoo
<SomeComponent className={classNames({'is-foo': isFoo})} />
(also, I personally shorten `classNames` to `cn` because it's so universally useful)
- seanwilson 5y agoYep, it would be nice if HTML/XML/CSS/Javascript/YAML/JSON/SQL identifiers were all standardised as it's not uncommon to see all of them in the same project.