![]() Import from 'react-router-dom'Īdditionally, we can pass props in Routes like how we pass props in any other react component and restrict routes based on the user’s role. If you are completely new to React Router v6, I will recommend you to watch this video.įirst, let’s create a PrivateRoute component, I have named it as a ProtectedRoutes but names should not matter. So how to solve this? Isn’t React Router v6 supposed to be easier?
0 Comments
Leave a Reply. |