Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对不同的页面有不同的路线。
<Routes> <Route path="/"/> <Route path='/app' element={home}/> </Routes>
react-router新版本中如何重定向/进入/app?
你可以做如下所示
<Routes> <Route exact path="/app" element={<home />} /> <Route path="*" element={<Navigate to="/" />} /> </Routes>