matchRoutes可以根据当前路径直接匹配到路由

import { Link, useLocation, matchRoutes } from 'react-router-dom';
matchRoutes(routes, url);

  

posted @ 2022-04-06 16:37  葫芦娃啊  阅读(568)  评论(0编辑  收藏  举报