Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
Mi enrutamiento privado ya no funciona debido a la actualización para reaccionar router-dom v6

Este es el código de un proyecto en el que trabajé hace un tiempo, pero ahora que lo miro, ya no se ejecuta debido a cambios en el react-router-dom. Intenté cambiar el interruptor a rutas y la redirección para navegar, sin embargo, no tuve suerte. Si alguien pudiera ayudarme con este problema sería muy apreciado! Código del tutorial de JWT en youtube: https://www.youtube.com/watch?v=cjqfF5hyZFg

 const [isAuthenticated, setIsAuthenticated] = useState(false); const setAuth = boolean => { setIsAuthenticated(boolean); }; return ( <Fragment> <Router> <div className="container"> <Switch> <Route exact path="/login" render={props => !isAuthenticated ? ( <Login {...props} setAuth={setAuth} /> ) : ( <Redirect to="/dashboard" /> ) } /> <Route exact path="/register" render={props => !isAuthenticated ? ( <Register {...props} setAuth={setAuth} /> ) : ( <Redirect to="/dashboard" /> ) } /> <Route exact path="/dashboard" render={props => isAuthenticated ? ( <Dashboard {...props} setAuth={setAuth} /> ) : ( <Redirect to="/login" /> ) } /> </Switch> </div> </Router> </Fragment> ); }```
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!