File tree Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
import React , { PropTypes } from 'react'
2
2
import {
3
3
location as locationType ,
4
- router as routerType
4
+ routerContext as routerContextType
5
5
} from './PropTypes'
6
6
7
7
class Link extends React . Component {
@@ -41,7 +41,7 @@ class Link extends React.Component {
41
41
}
42
42
43
43
static contextTypes = {
44
- router : routerType , // TODO: This should be required, lazy testers be damned
44
+ router : routerContextType , // TODO: This should be required, lazy testers be damned
45
45
location : locationType // TODO: This should also be required
46
46
}
47
47
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ export const location = PropTypes.shape({
21
21
key : PropTypes . string
22
22
} )
23
23
24
- export const router = PropTypes . shape ( {
25
- createHref : PropTypes . func . isRequired ,
24
+ export const routerContext = PropTypes . shape ( {
26
25
transitionTo : PropTypes . func . isRequired ,
27
26
replaceWith : PropTypes . func . isRequired ,
28
- blockTransitions : PropTypes . func . isRequired
27
+ blockTransitions : PropTypes . func . isRequired ,
28
+ createHref : PropTypes . func . isRequired
29
29
} )
30
30
31
31
export const action = PropTypes . oneOf ( [
Original file line number Diff line number Diff line change 1
1
import React , { PropTypes } from 'react'
2
2
import {
3
- router as routerType
3
+ routerContext as routerContextType
4
4
} from './PropTypes'
5
5
6
6
class Redirect extends React . Component {
@@ -12,7 +12,7 @@ class Redirect extends React.Component {
12
12
}
13
13
14
14
static contextTypes = {
15
- router : routerType ,
15
+ router : routerContextType ,
16
16
serverRouter : PropTypes . object
17
17
}
18
18
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import MatchProvider from './MatchProvider'
5
5
import {
6
6
action as actionType ,
7
7
location as locationType ,
8
- router as routerType
8
+ routerContext as routerContextType
9
9
} from './PropTypes'
10
10
11
11
const stringifyQuery = ( query ) => (
@@ -37,8 +37,8 @@ class StaticRouter extends React.Component {
37
37
}
38
38
39
39
static childContextTypes = {
40
- router : routerType . isRequired ,
41
- location : locationType . isRequired // TODO: Keep state updates out of context
40
+ router : routerContextType . isRequired ,
41
+ location : locationType . isRequired // TODO: Remove location state from context
42
42
}
43
43
44
44
createLocationForContext ( loc ) {
Original file line number Diff line number Diff line change 1
1
import expect from 'expect'
2
2
import React from 'react'
3
3
import StaticRouter from '../StaticRouter'
4
- import { router as routerType } from '../PropTypes'
4
+ import { routerContext as routerContextType } from '../PropTypes'
5
5
import { renderToString } from 'react-dom/server'
6
6
7
7
//console.error = () => {}
@@ -192,7 +192,7 @@ describe('StaticRouter', () => {
192
192
describe ( 'basename support' , ( ) => {
193
193
class Test extends React . Component {
194
194
static contextTypes = {
195
- router : routerType
195
+ router : routerContextType
196
196
}
197
197
198
198
render ( ) {
You can’t perform that action at this time.
0 commit comments