useMiddleware
can be called multiple times, but keep in mind that registration order matters. You can clear all your middleware functions by using router.clearMiddleware()
.toState
object by adding properties, or to pass a new state object in callbacks or promises. When passing a new object, the router will ignore it if initial state properties (name
, params
and path
) are changed.{ code: 'TRANSITION_ERR', error: '<your string>'}
{ code: 'TRANSITION_ERR', ...errorObject }