daniel-xie

导航

 

坑1:A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.

  6.0版本,引入了<Routes>组件来包裹<Route>

坑2:useHref() may be used only in the context of a <Router> component.

  <Link>组件必须包裹在<Router>内部使用

坑3:element属性替换原有的component属性

坑4:嵌套路由模糊匹配,父路由path后面要跟/*,子路由path后面不用带父路由路径

posted on 2023-01-31 10:34  danielX1024  阅读(18)  评论(0)    收藏  举报