Avoid leading spaces when first argument to joinClasses is falsy.

This detail is going to become more important once the idiom
`className={joinClasses(this.props.className, newClass)}` becomes more
common, as it will when we move away from `this.transferPropsTo`.
This commit is contained in:
Ben Newman
2014-07-18 22:01:36 -07:00
committed by Paul O’Shannessy
parent 5aab0bddaa
commit 66cdba3dfb
+3 -1
View File
@@ -35,7 +35,9 @@ function joinClasses(className/*, ... */) {
if (argLength > 1) {
for (var ii = 1; ii < argLength; ii++) {
nextClass = arguments[ii];
nextClass && (className += ' ' + nextClass);
if (nextClass) {
className = (className ? className + ' ' : '') + nextClass;
}
}
}
return className;