Skip to content

Commit bf69559

Browse files
committed
added upgrade guid for RouteContext
1 parent 01fded0 commit bf69559

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

upgrade-guides/v2.0.0.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,26 @@ import { RoutingContext } from 'react-router'
199199
// v2.0.0
200200
import { RouterContext } from 'react-router'
201201
```
202+
203+
204+
## `RouteContext` Mixin
205+
206+
```js
207+
// 1.x
208+
const RouteComponent = React.createClass({
209+
mixins: [ RouteContext ]
210+
})
211+
212+
// 2.0.0
213+
const RouteComponent = React.createClass({
214+
contextTypes: {
215+
route: React.PropTypes.object
216+
},
217+
getChildContext() {
218+
return {
219+
route: this.props.route
220+
}
221+
}
222+
})
223+
```
224+

0 commit comments

Comments
 (0)