Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

323
Vistas
How to get Full Route History from useHistory in react-router

I am working on useHistory() hook. I need to fill the breadcrumbs from the useHistory route. I need to fill the breadcrumbs from where we came to home page or '/'.I don't know how to do it using useHistory.I know only few methods like goBack(). But it gives only the previous route. I need the whole history stack. Is there any way to get that in react?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

For creating a breadcrumb, you could be making use of history's location object

Something like this:

function DashboardDetail() {
  const history = useHistory();

  const { pathname } = history.location;
  return (
    <div>
      <p>BreadCrumb: {pathname.split("/").join(" -> ")}</p>
      <h2>Dashboard Detail</h2>
    </div>
  );
}

Working Example:

Edit React Router - BreadCrumb

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda