<Route> in React Router v6
<Route> elements in React Router is changing in v6 from how it worked in v4/5 and in Reach Router. React Router v6 is the successor of both React Router v5 and Reach Router.
This document explains our rationale for making the change as well as a pattern you will want to avoid in v6 and a note on how you can start preparing your v5 app for v6 today.
In React Router v5, we had an example of how you could create a
<PrivateRoute> element to restrict access to certain routes on the page. This element was a simple wrapper around an actual
<Route> element that made a simple decision: is the user authenticated or not? If so, ren