useMatches
このコンテンツはまだ日本語訳がありません。
useMatches
返回页面上的当前路由匹配项。这对于使用当前路由创建布局抽象很有用。
function SomeComponent() { const matches = useMatches();
// ...}
matches
具有以下形状:
[ { id, pathname, data, params, handle }, // root route { id, pathname, data, params, handle }, // layout route { id, pathname, data, params, handle }, // child route // etc.];