A hook that handles route changes.

Since
  • 4.2.0
Returns:

The route handler state and actions.

Type: 
object

Methods

(inner) addRouteHandler(id, handler)

Add a route handler.

Parameters:
NameTypeDescription
idstring

The id of the route handler.

handlerfunction

The handler function.

Since
  • 4.2.0

(inner) removeRouteHandler(id)

Remove a route handler.

Parameters:
NameTypeDescription
idstring

The id of the route handler.

Since
  • 4.2.0

(inner) setRoute(params, options)

Set the route. Sets isNavigating to true to prevent the routeHandlers from running.

Parameters:
NameTypeDescription
paramsobject

The params to set.

optionsobject

The options to set.

Since
  • 4.2.0