koordinates / xstate-tree

Build UIs with Actors using xstate and React
MIT License
85 stars 6 forks source link

Add hook to enable determining if a route is active #37

Closed UberMouse closed 1 year ago

UberMouse commented 1 year ago

Something like useIsRouteActive(route: AnyRoute): boolean

Should be fairly simple to implement by checking if the activeRouteEvents array on the RoutingContext contains the given route or not.

UberMouse commented 1 year ago

This was implemented in https://github.com/koordinates/xstate-tree/pull/38