Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

259
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!