Skip to content

Commit f92cbae

Browse files
committed
Update docs for release
1 parent a4fee0f commit f92cbae

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

CHANGES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [v2.5.0]
2+
> Jun 22, 2016
3+
4+
- **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))
5+
- **Refactor:** Refactor creating `routeParams` objects ([#3544])
6+
7+
[v2.5.0]: https://github.com/reactjs/react-router/compare/v2.4.1...v2.5.0
8+
[#3544]: https://github.com/reactjs/react-router/pull/3544
9+
[#3556]: https://github.com/reactjs/react-router/pull/3556
10+
[#3561]: https://github.com/reactjs/react-router/pull/3561
11+
[#3569]: https://github.com/reactjs/react-router/pull/3569
12+
13+
114
## [v2.4.1]
215
> May 19, 2016
316

upgrade-guides/v2.2.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ getComponent(location, cb) {
1212
}
1313
```
1414

15-
You would need to instead write
15+
You would instead need to write
1616

1717
```js
1818
getComponent(nextState, cb) {
@@ -22,4 +22,4 @@ getComponent(nextState, cb) {
2222

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

25-
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.
25+
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.

upgrade-guides/v2.5.0.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# v2.5.0 Upgrade Guide
2+
3+
## `getChildRoutes`, `getIndexRoute` signature
4+
5+
**This is unlikely to affect you, even if you use `getChildRoutes` and `getIndexRoute`.**
6+
7+
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
8+
9+
```js
10+
getChildRoutes(location, cb) {
11+
cb(fetchRoutes(location.query))
12+
}
13+
```
14+
15+
You would instead need to write
16+
17+
```js
18+
getChildRoutes(partialNextState, cb) {
19+
cb(fetchRoutes(partialNextState.location.query))
20+
}
21+
```
22+
23+
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.
24+
25+
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 commit comments

Comments
 (0)