Protected routes and authorization using React Router v6
In the project I am currently working on, a specific need arose, we should protect certain routes of a web application from certain user roles (for security reasons). For example, we have a page where administrators can add and delete users, this power can only be held by us (this must be a private page). **React Router v6** (latest version), it does not offer any functionality for this type of situation, the implementation is the developer's task. My first approach to the problem was to try to build a "wrapper" for the `Route` component of React Router: ```js import { Navigate, Route }...
React