File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
packages/react-router/modules Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,7 @@ import RouterContext from "./RouterContext";
10
10
class Router extends React . Component {
11
11
static propTypes = {
12
12
history : PropTypes . object . isRequired ,
13
- children : PropTypes . node
14
- } ;
15
-
16
- static contextTypes = {
13
+ children : PropTypes . node ,
17
14
router : PropTypes . object
18
15
} ;
19
16
@@ -24,7 +21,7 @@ class Router extends React.Component {
24
21
getChildContext ( ) {
25
22
return {
26
23
router : {
27
- ...this . context . router ,
24
+ ...this . props . router ,
28
25
history : this . props . history ,
29
26
route : {
30
27
location : this . props . history . location ,
Original file line number Diff line number Diff line change @@ -129,7 +129,13 @@ class StaticRouter extends React.Component {
129
129
block : this . handleBlock
130
130
} ;
131
131
132
- return < Router { ...props } history = { history } /> ;
132
+ return (
133
+ < Router
134
+ { ...props }
135
+ history = { history }
136
+ router = { this . getChildContext ( ) . router }
137
+ />
138
+ ) ;
133
139
}
134
140
}
135
141
You can’t perform that action at this time.
0 commit comments