• 准备搜索索引...
  • 搜索索引不可用
React Router API 参考
  • React Router API 参考
  • react-router
  • useMatch

函数 useMatch

  • useMatch<ParamKey, Path>(pattern): PathMatch<ParamKey> | null
  • 如果给定的模式与当前 URL 匹配,则返回一个 PathMatch 对象。这对于需要知道“active”状态的组件很有用,例如 <NavLink>。

    类型参数

    • ParamKey extends string
    • Path extends string

    参数

    • pattern: Path | PathPattern<Path>

    返回 PathMatch<ParamKey> | null

    • 定义于 packages/react-router/lib/hooks.tsx:160

设置

成员可见性
React Router API 参考
  • 加载中...

使用 TypeDoc 生成