I created <RequireAuthRoute> which simply either returns its children or navigates to /login. However the way it is being used doesn't satisfy me. Take a look at this fragment:
<Route
path=''
element={
<RequireAuthRoute>
<Explorer />
</RequireAuthRoute>
}
/>
So yes - technically it works but what I wanted to do is to create wrapper for <Route> component so it would end up looking like this:
<ProtectedRoute path='' element={<Explorer/>}/>
Whats blocking me is react-router itself which tells me that <Router> direct child can only be <Route> component. Any workarounds?