File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ name through the link's properties to the resulting url.
27
27
The className a ` Link ` receives when it's route is active. Defaults to
28
28
` active ` .
29
29
30
+ ### * others*
31
+
32
+ You can also pass props you'd like to be on the ` <a> ` such as a title, id, or className.
33
+
30
34
Example
31
35
-------
32
36
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ var ActiveState = require('../mixins/ActiveState');
3
3
var withoutProperties = require ( '../helpers/withoutProperties' ) ;
4
4
var transitionTo = require ( '../helpers/transitionTo' ) ;
5
5
var makeHref = require ( '../helpers/makeHref' ) ;
6
-
6
+ var hasOwn = Function . prototype . call . bind ( Object . prototype . hasOwnProperty ) ;
7
7
/**
8
8
* A map of <Link> component props that are reserved for use by the
9
9
* router and/or React. All other props are used as params that are
@@ -124,6 +124,13 @@ var Link = React.createClass({
124
124
onClick : this . handleClick
125
125
} ;
126
126
127
+ // pull in props without overriding
128
+ for ( var propName in this . props ) {
129
+ if ( hasOwn ( this . props , propName ) && hasOwn ( props , propName ) === false ) {
130
+ props [ propName ] = this . props [ propName ] ;
131
+ }
132
+ }
133
+
127
134
return React . DOM . a ( props , this . props . children ) ;
128
135
}
129
136
You can’t perform that action at this time.
0 commit comments