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

257
Vistas
Error: Failed to obtain image address when using props and creating dynamic routes

So I am trying to dynamically render a component with its properties when I click on a button on another page with dynamic routes. My route path is:

<Route path="/prod/:id/:descr/:price/:image"><MakePurchase /></Route>

then I set up a link also as follows:

<Link to={"/prod/"+product.id+"/"+product.descr+"/"+product.price+""+product.image}>

In the component I want to render looks like this:

    return(
<>
...
<img src={props.match.params.image} alt=""/>
...
<h2>{props.match.params.descr}</h2>
<h3>Price: <span >&#8358;</span>{props.match.params.price}</h3>
...
</>
)
}

the values for price and descr are returned perfectly but for image, there is no image displayed. I did a console.error(props) which returns values like this

isExact: false
params:
descr: "PS5 Dual Sense Wireless Controller"
id: "300"
image: "static"
price: "25000" 

Please, how do I get the correct path for my image and display the image on the page?

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