Error with react-router v6
1 min readDec 15, 2021
I ran into the same issue today and came up with the following solution based on this very helpful article by Andrew Luca
In PrivateRoute.js:
import React from 'react';
import { Navigate, Outlet } from 'react-router-dom';const PrivateRoute = () => {
const auth = null; // determine if authorized…