From e40c5fbfdab076a537c01ca7a08dd0debb7b48ae Mon Sep 17 00:00:00 2001 From: Kiran Rao Date: Mon, 16 May 2016 10:54:36 -0400 Subject: [PATCH] Update to API.md Make optional arguments consistent with other documentation. --- docs/API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/API.md b/docs/API.md index 2cc7ded59a..d27824a488 100644 --- a/docs/API.md +++ b/docs/API.md @@ -335,12 +335,12 @@ 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/RouteConfiguration.md) since this is a very critical part of the router's design. -##### `onEnter(nextState, replace, callback?)` +##### `onEnter(nextState, replace, [callback])` 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. If `callback` is listed as a 3rd argument, this hook will run asynchronously, and the transition will block until `callback` is called. -##### `onChange(prevState, nextState, replace, callback?)` +##### `onChange(prevState, nextState, replace, [callback])` Called on routes when the location changes, but the route itself neither enters or leaves. For example, this will be called when a route's children change, or when the location query changes. It provides the previous router state, the next router state, and a function to redirect to another path. `this` will be the route instance that triggered the hook. If `callback` is listed as a 4th argument, this hook will run asynchronously, and the transition will block until `callback` is called.