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

456
Views
Intento de error de importación: 'Navegar' no se exporta desde 'react-router-dom'

Por favor, ayúdenme a lidiar con este error Intento de error de importación: 'Navegar' no se exporta desde 'react-router-dom' mi versión de react-router-dom es 4.1.1 Por favor, no me digan cómo actualizar a 5v o v6 porque En esas versiones, me enfrento a muchos errores, así que por favor explique cómo solucionar este error en la versión 4.1.1 de react-router-dom. El error es Intento de error de importación: 'Navegar' no se exporta desde 'react-router-dom'. todos ustedes también pueden ver la img del error imagen de error

mi codigo aqui

 import { Navigate, useLocation } from "react-router-dom"; import { useAppSelector } from "../app/hooks"; export function PrivateRoute({ children }: { children: JSX.Element }) { const { isAuthenticated } = useAppSelector((state) => state.auth); const location = useLocation(); return isAuthenticated ? ( children ) : ( <Navigate to="/login" state={{ from: location }} /> ); }
about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Intente reemplazar Navigate con Link.

 import { Link, useLocation } from "react-router-dom"; ... <Link to "/login" state={{ from: location }} />
about 4 years ago · Santiago Trujillo Report

0

Use Redirigir en lugar de Navegar en la versión 4, así

 import { Redirect, useLocation } from "react-router-dom"; import { useAppSelector } from "../app/hooks"; export function PrivateRoute({ children }: { children: JSX.Element }) { const { isAuthenticated } = useAppSelector((state) => state.auth); const location = useLocation(); return isAuthenticated ? ( children ) : ( <Redirect to="/login" state={{ from: location }} /> ); }
about 4 years ago · Santiago Trujillo Report
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!