A hook that handles route changes.

Since
  • 4.2.0
Returns:

The route handler state and actions.

Type: 
object

Methods

(inner) addRouteHandler(id, handler, replace) → {void}

Add a route handler.

Parameters:
NameTypeDescription
idstring

The id of the route handler.

handlerfunction

The handler function.

replaceboolean

Whether to replace the existing route handler.

Since
  • 4.2.0
Returns:
Type: 
void

(inner) removeRouteHandler(id) → {void}

Remove a route handler.

Parameters:
NameTypeDescription
idstring

The id of the route handler.

Since
  • 4.2.0
Returns:
Type: 
void

(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