DEV Community

Discussion on: 🔐 Private Route in React Router v6

Collapse
 
nichitaa profile image
Pasecinic Nichita

You could use auth-react-router package npmjs.com/package/auth-react-router

It provides a really simple API to define your routes and few more configurations (like redirect routes for authorized and unauthorized routes, fallback component for each of the routes)

Just define your routes path and pages component and it will work