本页还没有译文
本页 17 段还没译成简体中文,下面显示的是英文原文。matchRoutes
还没翻译译自英文(reactrouter.com)本页 17 段都还没译
matchRoutes
Framework Data Declarative
Summary
Matches the given routes to a location and returns the match data.
import { matchRoutes } from "react-router";
let routes = [{
path: "/",
Component: Root,
children: [{
path: "dashboard",
Component: Dashboard,
}]
}];
matchRoutes(routes, "/dashboard"); // [rootMatch, dashboardMatch]Signature
function matchRoutes<RouteObjectType extends RouteObject = RouteObject>(
routes: RouteObjectType[],
locationArg: Partial<Location> | string,
basename = "/",
): RouteMatch<string, RouteObjectType>[] | nullParams
routes
The array of route objects to match against.
locationArg
The location to match against, either a string path or a partial Location object
basename
Optional base path to strip from the location before matching. Defaults to /.
Returns
An array of matched routes, or null if no matches were found.
AI 翻译查看英文原文