skip to Main Content

Reactjs – Determine Which Route Was Resolved

Given routes like this: <Routes> <Route element={<MainLayout />}> <Route path="foo/:token" element={<Foo />} /> <Route path=":token" element={<Bar />}> <Route path=":id" element={<Baz />}> <Route> </Route> </Routes> How can MainLayout know which route was resolved? I need to know if it was within…

VIEW QUESTION
Back To Top
Search