Skip to content

Commit

Permalink
Remove context.history/location and History mixin.
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Apr 21, 2016
1 parent b3c37a8 commit e089426
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 76 deletions.
20 changes: 0 additions & 20 deletions modules/History.js

This file was deleted.

14 changes: 3 additions & 11 deletions modules/RouterContext.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import invariant from 'invariant'
import React from 'react'

import deprecateObjectProperties from './deprecateObjectProperties'
import getRouteParams from './getRouteParams'
import { isReactChildren } from './RouteUtils'
import warning from './routerWarning'
Expand All @@ -15,9 +14,7 @@ const { array, func, object } = React.PropTypes
const RouterContext = React.createClass({

propTypes: {
history: object,
router: object.isRequired,
location: object.isRequired,
routes: array.isRequired,
params: object.isRequired,
components: array.isRequired,
Expand All @@ -31,13 +28,12 @@ const RouterContext = React.createClass({
},

childContextTypes: {
history: object,
location: object.isRequired,
router: object.isRequired
},

getChildContext() {
let { router, history, location } = this.props
let { router, history } = this.props

if (!router) {
warning(false, '`<RouterContext>` expects a `router` rather than a `history`')

Expand All @@ -48,11 +44,7 @@ const RouterContext = React.createClass({
delete router.listenBeforeLeavingRoute
}

if (__DEV__) {
location = deprecateObjectProperties(location, '`context.location` is deprecated, please use a route component\'s `props.location` instead. http://tiny.cc/router-accessinglocation')
}

return { history, location, router }
return { router }
},

createElement(component, props) {
Expand Down
44 changes: 0 additions & 44 deletions modules/__tests__/_bc-History-test.js

This file was deleted.

1 change: 0 additions & 1 deletion modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export Redirect from './Redirect'
export Route from './Route'

/* mixins */
export History from './History'
export Lifecycle from './Lifecycle'
export RouteContext from './RouteContext'

Expand Down

0 comments on commit e089426

Please sign in to comment.