Skip to content

Commit e2a979e

Browse files
committed
Merge pull request #2423 from taion/API-onEnter
Add callback to onEnter entry in API docs
2 parents 965a5b8 + a948810 commit e2a979e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/API.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,11 @@ code-splitting.
255255
##### `children`
256256
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.
257257

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

261+
If `callback` is listed as a 3rd argument, this hook will run asynchronously, and the transition will block until `callback` is called.
262+
261263
##### `onLeave()`
262264
Called when a route is about to be exited.
263265

0 commit comments

Comments
 (0)