File tree Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -9,30 +9,26 @@ const { string, object } = React.PropTypes
9
9
/**
10
10
* An <IndexRedirect> is used to redirect from an indexRoute.
11
11
*/
12
- const IndexRedirect = React . createClass ( {
13
-
14
- statics : {
15
-
16
- createRouteFromReactElement ( element , parentRoute ) {
17
- if ( parentRoute ) {
18
- parentRoute . indexRoute = Redirect . createRouteFromReactElement ( element )
19
- } else {
20
- warning (
21
- false ,
22
- 'An <IndexRedirect> does not make sense at the root of your route config'
23
- )
24
- }
12
+ class IndexRedirect extends React . Component {
13
+
14
+ static createRouteFromReactElement ( element , parentRoute ) {
15
+ if ( parentRoute ) {
16
+ parentRoute . indexRoute = Redirect . createRouteFromReactElement ( element )
17
+ } else {
18
+ warning (
19
+ false ,
20
+ 'An <IndexRedirect> does not make sense at the root of your route config'
21
+ )
25
22
}
23
+ }
26
24
27
- } ,
28
-
29
- propTypes : {
25
+ static propTypes = {
30
26
to : string . isRequired ,
31
27
query : object ,
32
28
state : object ,
33
29
onEnter : falsy ,
34
30
children : falsy
35
- } ,
31
+ }
36
32
37
33
render ( ) {
38
34
invariant (
@@ -41,6 +37,6 @@ const IndexRedirect = React.createClass({
41
37
)
42
38
}
43
39
44
- } )
40
+ }
45
41
46
42
export default IndexRedirect
You can’t perform that action at this time.
0 commit comments