Skip to content

Commit c8510da

Browse files
committed
Rename PropTypes.router => PropTypes.routerContext
1 parent 16aeede commit c8510da

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

modules/Link.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { PropTypes } from 'react'
22
import {
33
location as locationType,
4-
router as routerType
4+
routerContext as routerContextType
55
} from './PropTypes'
66

77
class Link extends React.Component {
@@ -41,7 +41,7 @@ class Link extends React.Component {
4141
}
4242

4343
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
4545
location: locationType // TODO: This should also be required
4646
}
4747

modules/PropTypes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export const location = PropTypes.shape({
2121
key: PropTypes.string
2222
})
2323

24-
export const router = PropTypes.shape({
25-
createHref: PropTypes.func.isRequired,
24+
export const routerContext = PropTypes.shape({
2625
transitionTo: PropTypes.func.isRequired,
2726
replaceWith: PropTypes.func.isRequired,
28-
blockTransitions: PropTypes.func.isRequired
27+
blockTransitions: PropTypes.func.isRequired,
28+
createHref: PropTypes.func.isRequired
2929
})
3030

3131
export const action = PropTypes.oneOf([

modules/Redirect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { PropTypes } from 'react'
22
import {
3-
router as routerType
3+
routerContext as routerContextType
44
} from './PropTypes'
55

66
class Redirect extends React.Component {
@@ -12,7 +12,7 @@ class Redirect extends React.Component {
1212
}
1313

1414
static contextTypes = {
15-
router: routerType,
15+
router: routerContextType,
1616
serverRouter: PropTypes.object
1717
}
1818

modules/StaticRouter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import MatchProvider from './MatchProvider'
55
import {
66
action as actionType,
77
location as locationType,
8-
router as routerType
8+
routerContext as routerContextType
99
} from './PropTypes'
1010

1111
const stringifyQuery = (query) => (
@@ -37,8 +37,8 @@ class StaticRouter extends React.Component {
3737
}
3838

3939
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
4242
}
4343

4444
createLocationForContext(loc) {

modules/__tests__/StaticRouter-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import expect from 'expect'
22
import React from 'react'
33
import StaticRouter from '../StaticRouter'
4-
import { router as routerType } from '../PropTypes'
4+
import { routerContext as routerContextType } from '../PropTypes'
55
import { renderToString } from 'react-dom/server'
66

77
//console.error = () => {}
@@ -192,7 +192,7 @@ describe('StaticRouter', () => {
192192
describe('basename support', () => {
193193
class Test extends React.Component {
194194
static contextTypes = {
195-
router: routerType
195+
router: routerContextType
196196
}
197197

198198
render() {

0 commit comments

Comments
 (0)