use/useSuggestRoute
Overview
Suggests the best matching route for the current path using string similarity against all registered routes.
Methods
- useSuggestRoute - A hook to suggest a route based on the current route.
- useSuggestRoutes - A hook that returns the N best matching routes for the current path with similarity scores.
Types
RouteMatch
| Name | Type | Description |
|---|---|---|
| matchedPath | string | |
| score | number |
SuggestedRoute
| Name | Type | Description |
|---|---|---|
| matchedPath | string | |
| route | object | |
| score | number |
Source
client/lib/use/useSuggestRoute.js:1