I upgraded to v6 of react router and now everything is off.
I have this that manages all routes basically but can not figure out how to make it work with v6:
export const Routes: React.FC<RouteProps> = ({ component: Component, ...rest }) => (
<Route
{...rest}
render={(props) => (
<Suspense fallback={<div>Loading...</div>}>
<Layout>{Component && <Component {...props} />}</Layout>
</Suspense>
)}
/>
);