在版本 5 中,我可以通过这种方式执行检查https://v5.reactrouter.com/web/api/matchPath
import { matchPath } from "react-router";
const match = matchPath("/users/123", {
path: "/users/:id",
exact: true,
strict: false
});
Run Code Online (Sandbox Code Playgroud)
在版本 6 中,我在屏幕上看到错误。现在应该如何运作? 错误:pathname.match 不是函数