mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
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:
1 parent
5aab0bddaa
commit
66cdba3dfb
1 file changed
+3
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user