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

141
Vistas
How do get params that have no specific names

I have been trying to find how to get multiple params in react and in most of the examples the params have names like :id e.g

to="/movie/:id"

So to get such you just use:

const {id} = useParams();

But for my case i don't have specific names. How to i get these params?

//res is an object
<Link to={`/movie/${res.id}/${res.link_id}`}>
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I have figured it out. I confused <Route> with <Link>

In the <Link> tag i don't need to define the params. It is the <Route> tag that the params are already defined i.e

<Route path='/movie/:movieId/:linkId' element={<Movie />} />

//Then in link tag is just an like an <a> tag
<Link to={`/movie/${res.id}/${res.link_id}`}>

Then in my component I just get them as

const {movieId,linkId} = useParams()
about 4 years ago · Juan Pablo Isaza Denunciar

0

You have to assign the component in the Link props: Suppose that your new Component is named MovieDetails.

const MovieDetails=()=>{
    const {id} = useParams();
}

Link Component:

<Link to={`/movie/${res.id}/${res.link_id}`} component={MovieDetails}>
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