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

140
Vistas
how to pass a variable to a component from history.replace

how can I access this match.chatroomId in the functional component ?? I use history.replace to redirect to the component onClick = {() => history.replace(`/chat/${match.chatroomId}`)}

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

0

using react hook useParams() This is url - http://localhost:8000/personal/1.

So in this case, use const { id } = useParams()

now, if you do console.log(id) , it will give you the exact id of the url. In this case it will give you 1.

useParams() extracts the id from the url and lets us use it.

Thanks.

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