Skip to content

Commit da91078

Browse files
committed
Merge pull request #1886 from lime008/master
Docs update on getComponents
2 parents e8cfe97 + 3f608e2 commit da91078

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/advanced/DynamicRouting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var CourseRoute = {
2828
})
2929
},
3030

31-
getComponents(callback) {
31+
getComponents(location, callback) {
3232
require.ensure([], function (require) {
3333
callback(null, require('./components/Course'))
3434
})
@@ -38,4 +38,4 @@ var CourseRoute = {
3838

3939
Now go look at what hacks you have in place to do this. Just kidding, I don't want to make you sad right now.
4040

41-
Run the [huge apps](https://github.com/rackt/react-router/tree/master/examples/huge-apps) example with your web inspector open and watch code get loaded in as you navigate around the demo.
41+
Run the [huge apps](https://github.com/rackt/react-router/tree/master/examples/huge-apps) example with your web inspector open and watch code get loaded in as you navigate around the demo.

docs/api/Route.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var Users = React.createClass({
9595
});
9696
```
9797

98-
#### `getComponent(callback)`
98+
#### `getComponent(location, callback)`
9999

100100
Same as `component` but asynchronous, useful for
101101
code-splitting.
@@ -107,13 +107,13 @@ code-splitting.
107107
##### Example
108108

109109
```js
110-
<Route path="courses/:courseId" getComponent={(cb) => {
110+
<Route path="courses/:courseId" getComponent={(location, cb) => {
111111
// do asynchronous stuff to find the components
112112
cb(null, Course);
113113
}}/>
114114
```
115115

116-
#### `getComponents(callback)`
116+
#### `getComponents(location, callback)`
117117

118118
Same as `components` but asynchronous, useful for
119119
code-splitting.
@@ -125,7 +125,7 @@ code-splitting.
125125
##### Example
126126

127127
```js
128-
<Route path="courses/:courseId" getComponent={(cb) => {
128+
<Route path="courses/:courseId" getComponent={(location, cb) => {
129129
// do asynchronous stuff to find the components
130130
cb(null, {sidebar: CourseSidebar, content: Course});
131131
}}/>
@@ -141,4 +141,4 @@ Called when a route is about to be entered. It provides the next router state an
141141

142142
#### `onLeave()`
143143

144-
Called when a route is about to be exited.
144+
Called when a route is about to be exited.

0 commit comments

Comments
 (0)