Replies: 1 comment
-
@voliva this is a great list of questions, were you able to answer any? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've managed to migrate my app from v5 to v6 without too much hassle... Changing
<Switch>
to<Routes>
, etc.However, I was about to start a new project and decided to look at the new tutorial. In there I find that this way of defining routes is now replaced by a new way of doing them, directly on the RouterProvider:
I get that a good advantage of this is that now all routes are easily identifiable because they are all in a single place. However, I really liked the composability of the previous version, where on every level you could define the routes relative to that specific level.
You would have a component with a
<Switch>
(now<Routes>
) that would just render the home page (/), or the contacts page (/contacts). Then the contacts component would have internally another with its own sub-routes. In a way, the top-level router doesn't care about what inner routes the child router has.createBrowserRouter(...)
to grow indefinetly as the project grows?<Outlet />
is going to be replaced with? (specially if there are multiple nested levels... I imagine you need to see how that component is rendered on the component tree, then look at the routes definition to find the path it's going to be filled with)Beta Was this translation helpful? Give feedback.
All reactions