mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +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:
committed by
Paul O’Shannessy
parent
5aab0bddaa
commit
66cdba3dfb
@@ -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