unprotected and protected routes in react-router routerprovider #11558
Unanswered
navaniharsh31
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I had previously built an app using the old way of react-router in this way
App.jsx
AppProtectedRoutes
AppUnprotectedRoutes
How do I convert these to the RouteObject so that authenticated users can only access Protected only and unauthenticated users can access Unprotected only?
Also since RouteProvider would be in the index.js file, what should App.js contain other than the main logic?
PS- I prefer splitting routes in multiple files
Beta Was this translation helpful? Give feedback.
All reactions