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

101
Views
How to populate components on a new page when clicking on component in current page

I'm building a front-end project in React and in it, I want to be able to click on a thumbnail image component on a Home page that will redirect me to another page that renders components depending on the information for the thumbnail component that I clicked on.

For reference, this is a project that allows users to search for recipes from an external API. The thumbnail component they'll be clicking on will be an image and title of a recipe. When they click on that component they will get redirected to a meal page that has components for recipe name, image, servings, ingredients, directions, etc. and those components will render using information from the thumbnail from the Home page.

To summarize, here's what I want to do: When I click on a recipe in the Home page, I want to be redirected to a page that shows information for the recipe I clicked on.

So my main question is 'Is this possible?'

Thanks and feel free to let me know if you need more info.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

To achieve that you probably should use a package named 'react-router-dom'.

  1. You should setup a react-router. Here is docs for that.
<Route path="/recipe/:id">
  <RecipePage />
</Route>
  1. Your thumbnail should navigate to Recipe Page with the given ID.
  2. You should fetch recipe data from API:
// Recipe page  

import { useHistory, useParams } from 'react-router-dom'


const { id } = useParams()
const recipe = await fetch('api/recipe/' + id)
about 4 years ago · Juan Pablo Isaza Report
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!