Estoy trabajando en un proyecto, usando este modelo https://github.com/ankushjain2001/fastapi-react-mongodb y actualicé las dependencias para la interfaz a nuevas versiones principales.
Ya arreglé algunos errores, pero no puedo refactorizar correctamente las rutas personalizadas...
Así es como se usa en App.js <ProtectedRoute path="/admin" exact strict component={Home} />
Y este es el componente en sí
export const ProtectedRoute = ({component: Component, ...rest}) => { return ( <Route {...rest} render={props => { // Goto the concerned route when authenticated if (auth.isAuthenticated()){ return <Component {...props}/> } // Goto the default login page when not authenticated else { return ( <div> <Landing {...props}/> </div> ) } }} /> ); };El error que estoy recibiendo es:
Uncaught Error: [ProtectedRoute] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>¿Cómo puedo arreglar esto? Gracias por adelantado :)