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

99
Vistas
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 Respuestas
Responde la pregunta

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 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