📜  useRouteMatch - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:15.998000             🧑  作者: Mango

代码示例2
// React Router v5:
// hook without argument returns match obj of current 
// or takes obj argument identical to 'props' argument of matchPath
import { useRouteMatch } from 'react-router-dom'

function BlogPost() {
 let match = useRouteMatch({ 
   '/blog/:slug', 
   strict: true, 
   sensitive: true 
 })
 // Do something with the match...
 return 
}