Skip to content

Commit

Permalink
Merge pull request #2423 from taion/API-onEnter
Browse files Browse the repository at this point in the history
Add callback to onEnter entry in API docs
  • Loading branch information
knowbody committed Oct 30, 2015
2 parents 965a5b8 + a948810 commit e2a979e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ code-splitting.
##### `children`
Routes can be nested, `this.props.children` will contain the element created from the child route component. Please refer to the [Route Configuration](/docs/guides/basics/RouteConfiguration.md) since this is a very critical part of the router's design.

##### `onEnter(nextState, replaceState)`
##### `onEnter(nextState, replaceState, callback?)`
Called when a route is about to be entered. It provides the next router state and a function to redirect to another path.

If `callback` is listed as a 3rd argument, this hook will run asynchronously, and the transition will block until `callback` is called.

##### `onLeave()`
Called when a route is about to be exited.

Expand Down

0 comments on commit e2a979e

Please sign in to comment.