Skip to content

Commit 8e2576f

Browse files
committed
Update documentation
1 parent 2c90d04 commit 8e2576f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/API.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ A function used to convert an object from [`<Link>`](#link)s or calls to
8585
A function used to convert a query string into an object that gets passed to route component props.
8686

8787
##### `onError(error)`
88-
While the router is matching, errors may bubble up, here is your opportunity to catch and deal with them. Typically these will come from async features like [`route.getComponents`](#getcomponentsnextstate-callback), [`route.getIndexRoute`](#getindexroutelocation-callback), and [`route.getChildRoutes`](#getchildrouteslocation-callback).
88+
While the router is matching, errors may bubble up, here is your opportunity to catch and deal with them. Typically these will come from async features like [`route.getComponents`](#getcomponentsnextstate-callback), [`route.getIndexRoute`](#getindexroutelocation-callback), and [`route.getChildRoutes`](#getchildroutesprogressstate-callback).
8989

9090
##### `onUpdate()`
9191
Called whenever the router updates its state in response to URL changes.
@@ -368,8 +368,8 @@ A plain JavaScript object route definition. `<Router>` turns JSX `<Route>`s into
368368
##### `childRoutes`
369369
An array of child routes, same as `children` in JSX route configs.
370370

371-
##### `getChildRoutes(location, callback)`
372-
Same as `childRoutes` but asynchronous and receives the `location`. Useful for code-splitting and dynamic route matching (given some state or session data to return a different set of child routes).
371+
##### `getChildRoutes(progressState, callback)`
372+
Same as `childRoutes` but asynchronous and receives the `progressState`. Useful for code-splitting and dynamic route matching (given some state or session data to return a different set of child routes).
373373

374374
###### `callback` signature
375375
`cb(err, routesArray)`
@@ -399,8 +399,8 @@ let myRoute = {
399399

400400
let myRoute = {
401401
path: 'picture/:id',
402-
getChildRoutes(location, cb) {
403-
let { state } = location
402+
getChildRoutes(progressState, cb) {
403+
let { state } = progressState
404404

405405
if (state && state.fromDashboard) {
406406
cb(null, [dashboardPictureRoute])

docs/guides/DynamicRouting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ A router is the perfect place to handle code splitting: it's responsible for set
1010

1111
React Router does all of its [path matching](/docs/guides/RouteMatching.md) and component fetching asynchronously, which allows you to not only load up the components lazily, *but also lazily load the route configuration*. You really only need one route definition in your initial bundle, the router can resolve the rest on demand.
1212

13-
Routes may define [`getChildRoutes`](/docs/API.md#getchildrouteslocation-callback), [`getIndexRoute`](/docs/API.md#getindexroutelocation-callback), and [`getComponents`](/docs/API.md#getcomponentsnextstate-callback) methods. These are asynchronous and only called when needed. We call it "gradual matching". React Router will gradually match the URL and fetch only the amount of route configuration and components it needs to match the URL and render.
13+
Routes may define [`getChildRoutes`](/docs/API.md#getchildroutesprogressstate-callback), [`getIndexRoute`](/docs/API.md#getindexroutelocation-callback), and [`getComponents`](/docs/API.md#getcomponentsnextstate-callback) methods. These are asynchronous and only called when needed. We call it "gradual matching". React Router will gradually match the URL and fetch only the amount of route configuration and components it needs to match the URL and render.
1414

1515
Coupled with a smart code splitting tool like [webpack](http://webpack.github.io/), a once tiresome architecture is now simple and declarative.
1616

1717
```js
1818
const CourseRoute = {
1919
path: 'course/:courseId',
2020

21-
getChildRoutes(location, callback) {
21+
getChildRoutes(progressState, callback) {
2222
require.ensure([], function (require) {
2323
callback(null, [
2424
require('./routes/Announcements'),

0 commit comments

Comments
 (0)