#Migrating to RouterProvider setup

1 messages · Page 1 of 1 (latest)

ancient tree
#

Hello folks!

I have just started a application from BrowserRouter to RouterProvider but I am struggling on how to setup the routes, my application has some very deeply nested routes, which is working perfectly using the BrowserRouter and <Routes>, <Route> setup. Since each page/component can just have its own <Routes>. But it seems like with RouterProvider I need to define all routes in the root of my application which means importing everything there as well.

Now I am curious how others have made this transition, and what your folder/route setup looks like.

I would love to have a brainstorm session on what would be the best setup for me!

#

My current routes look something like this:
/
/login
/login/2fa
/login/reset2fa
.....
/register
/register/verifyemail
.....
/adminpanel
/adminpanel/overview
/adminpanel/organisations
/adminpanel/organisations/:id
/adminpanel/organisations/:id/edit

and probably like a 100 extra routes

#

😅