Skip to content

Commit

Permalink
Update docs for release
Browse files Browse the repository at this point in the history
  • Loading branch information
taion committed Jun 22, 2016
1 parent c5b9851 commit 4eec0a3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
13 changes: 13 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## [v2.5.0]
> Jun 22, 2016
- **Feature/Deprecation:** Call `getChildRoutes` and `getIndexRoute` with `partialNextState`; deprecate accessing `location` directly in favor of `partialNextState.location` there ([#3556], [#3561], [#3569], [Upgrade Guide](/upgrade-guides/v2.5.0.md#getchildroutes-getindexroute-signature))
- **Refactor:** Refactor creating `routeParams` objects ([#3544])

[v2.5.0]: https://github.com/reactjs/react-router/compare/v2.4.1...v2.5.0
[#3544]: https://github.com/reactjs/react-router/pull/3544
[#3556]: https://github.com/reactjs/react-router/pull/3556
[#3561]: https://github.com/reactjs/react-router/pull/3561
[#3569]: https://github.com/reactjs/react-router/pull/3569


## [v2.4.1]
> May 19, 2016
Expand Down
4 changes: 2 additions & 2 deletions upgrade-guides/v2.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ getComponent(location, cb) {
}
```

You would need to instead write
You would instead need to write

```js
getComponent(nextState, cb) {
Expand All @@ -22,4 +22,4 @@ getComponent(nextState, cb) {

However, you now also have access to the matched `params` on `nextState`, and can use those to determine which component to return.

You will still be able to access location properties directly on `nextState` until the next breaking release (and in fact they will shadow router state properties, if applicable), but this will case a deprecation warning in development mode.
You will still be able to access location properties directly on `nextState` until the next breaking release (and in fact they will shadow router state properties, if applicable), but this will cause a deprecation warning in development mode.
25 changes: 25 additions & 0 deletions upgrade-guides/v2.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# v2.5.0 Upgrade Guide

## `getChildRoutes`, `getIndexRoute` signature

**This is unlikely to affect you, even if you use `getChildRoutes` and `getIndexRoute`.**

The signature of `getChildRoutes` and `getIndexRoute` has been changed from `(location: Location, callback: Function) => any` to `(partialNextState: RouterState, callback: Function) => any`. That means that instead of writing

```js
getChildRoutes(location, cb) {
cb(fetchRoutes(location.query))
}
```

You would instead need to write

```js
getChildRoutes(partialNextState, cb) {
cb(fetchRoutes(partialNextState.location.query))
}
```

However, you now also have access to the partial matched `params` up to that point on `partialNextState`, and can use those to determine which routes to return.

You will still be able to access location properties directly on `partialNextState` until the next breaking release (and in fact they will shadow router state properties, if applicable), but this will cause a deprecation warning in development mode.

0 comments on commit 4eec0a3

Please sign in to comment.