Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/advanced/DynamicRouting.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var CourseRoute = {
})
},

getComponents(callback) {
getComponents(location, callback) {
require.ensure([], function (require) {
callback(null, require('./components/Course'))
})
Expand All @@ -38,4 +38,4 @@ var CourseRoute = {

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.

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.
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.
10 changes: 5 additions & 5 deletions docs/api/Route.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var Users = React.createClass({
});
```

#### `getComponent(callback)`
#### `getComponent(location, callback)`

Same as `component` but asynchronous, useful for
code-splitting.
Expand All @@ -107,13 +107,13 @@ code-splitting.
##### Example

```js
<Route path="courses/:courseId" getComponent={(cb) => {
<Route path="courses/:courseId" getComponent={(location, cb) => {
// do asynchronous stuff to find the components
cb(null, Course);
}}/>
```

#### `getComponents(callback)`
#### `getComponents(location, callback)`

Same as `components` but asynchronous, useful for
code-splitting.
Expand All @@ -125,7 +125,7 @@ code-splitting.
##### Example

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

#### `onLeave()`

Called when a route is about to be exited.
Called when a route is about to be exited.