@@ -5,23 +5,6 @@ import {
5
5
} from './PropTypes'
6
6
7
7
class Link extends React . Component {
8
- static propTypes = {
9
- to : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . object ] ) . isRequired ,
10
- activeStyle : PropTypes . object ,
11
- activeClassName : PropTypes . string ,
12
- location : PropTypes . object ,
13
- activeOnlyWhenExact : PropTypes . bool ,
14
- isActive : PropTypes . func ,
15
- children : PropTypes . oneOfType ( [ PropTypes . node , PropTypes . func ] ) ,
16
-
17
- // props we have to deal with but aren't necessarily
18
- // part of the Link API
19
- style : PropTypes . object ,
20
- className : PropTypes . string ,
21
- target : PropTypes . string ,
22
- onClick : PropTypes . func
23
- }
24
-
25
8
static defaultProps = {
26
9
activeOnlyWhenExact : false ,
27
10
className : '' ,
@@ -121,6 +104,25 @@ class Link extends React.Component {
121
104
}
122
105
}
123
106
107
+ if ( __DEV__ ) {
108
+ Link . propTypes = {
109
+ to : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . object ] ) . isRequired ,
110
+ activeStyle : PropTypes . object ,
111
+ activeClassName : PropTypes . string ,
112
+ location : PropTypes . object ,
113
+ activeOnlyWhenExact : PropTypes . bool ,
114
+ isActive : PropTypes . func ,
115
+ children : PropTypes . oneOfType ( [ PropTypes . node , PropTypes . func ] ) ,
116
+
117
+ // props we have to deal with but aren't necessarily
118
+ // part of the Link API
119
+ style : PropTypes . object ,
120
+ className : PropTypes . string ,
121
+ target : PropTypes . string ,
122
+ onClick : PropTypes . func
123
+ }
124
+ }
125
+
124
126
// we should probably use LocationUtils.createLocationDescriptor
125
127
const createLocationDescriptor = ( to ) =>
126
128
typeof to === 'object' ? to : { pathname : to }
0 commit comments