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

107
Vistas
React V6 having issues navigating from Class component

After making the changes required by react-router-dom 6, it seems like we no longer receive props from the dom, hence I am no longer able to navigate and pass params this way.

    this.props.history.push({
      pathname: "/search",
      state: sessionStorage.getItem("user"),
    });

I read that an alternative to that was to use useNavigate and it was possible to wrap a class component inside a function and export it as such:

// Wrap and export
export default function (props) {
  const navigation = useNavigate();
  return <login {...props} navigation={navigation} />;
}

This seems too hacky and did not work. anyone is using navigation with passing parameters in Dom v6? how is it done?

Thank you

about 4 years ago · Juan Pablo Isaza
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