Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
const { path, url } = useRouteMatch()
从钩子返回的这两个解构属性有什么区别?我记录了它们,但它们看起来一样。
在浏览 的源代码时react-router,我发现了这一点: //path让我们构建 // 相对于父路由的路径,而url让 // 我们构建相对链接。
react-router
path
url
let { path, url } = useRouteMatch();
阅读useRouteMatch()github上的源代码
useRouteMatch()
useRouteMatch()例子