This namespace is used to match path to routes. This is done during the server side render, client side hydration, and in the service worker
import { matchAllRoutes } from "@quintype/framework/isomorphic/match-best-route";
Methods
# inner matchAllRoutes(path, routes) → {Array.<module:match-best-route~Route>}
Find all routes that match a given path
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
The current path |
routes |
Array.<module:match-best-route~Route>
|
An array of routes to be matched |
Matching Routes
Array.<module:match-best-route~Route>
Type Definitions
# Route
Route represents a url pattern which is matched by the quintype framework. See Routing for more information on how the route is used.
{
path: "/my-route/:routeParam",
pageType: "home-page",
exact: true,
params: { foo: "bar" }
}
Properties:
Name | Type | Description |
---|---|---|
path |
string
|
The path that the route matches. |
pageType |
string
|
The page type |
exact |
boolean
|
Is this route an exact match or a prefix |