Skip to content

Commit 4a5ff49

Browse files
committed
Merge pull request #2501 from jlongster/master
explain what `this` refers to in `onEnter` hooks
2 parents e6e29a0 + faab374 commit 4a5ff49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ code-splitting.
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

258258
##### `onEnter(nextState, replaceState, callback?)`
259-
Called when a route is about to be entered. It provides the next router state and a function to redirect to another path.
259+
Called when a route is about to be entered. It provides the next router state and a function to redirect to another path. `this` will be the route instance that triggered the hook.
260260

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

0 commit comments

Comments
 (0)