File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
var React = require ( 'react' ) ;
2
+ var classSet = require ( 'react/lib/cx' ) ;
2
3
var merge = require ( 'react/lib/merge' ) ;
3
4
var ActiveState = require ( '../mixins/ActiveState' ) ;
4
5
var Navigation = require ( '../mixins/Navigation' ) ;
@@ -80,12 +81,15 @@ var Link = React.createClass({
80
81
* the value of the activeClassName property when this <Link> is active.
81
82
*/
82
83
getClassName : function ( ) {
83
- var className = this . props . className || '' ;
84
+ var classNames = { } ;
85
+
86
+ if ( this . props . className )
87
+ classNames [ this . props . className ] = true ;
84
88
85
89
if ( this . isActive ( this . props . to , this . props . params , this . props . query ) )
86
- className += ' ' + this . props . activeClassName ;
90
+ classNames [ this . props . activeClassName ] = true ;
87
91
88
- return className ;
92
+ return classSet ( classNames ) ;
89
93
} ,
90
94
91
95
render : function ( ) {
You can’t perform that action at this time.
0 commit comments