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

211
Vistas
Rendering an image in React

I am working on an app which has a product page and an image won't render on the website despite the rest of the information on inside the return statement rendered. I have no errors on web dev tools, the app compiled successfully with the following code.

ProductScreen.js

import React from 'react';
import data from '../data';
import Rating from '../components/Rating';
import { Link, useParams } from 'react-router-dom';

function ProductScreen() {

  const { id } = useParams();
  // const params = useParams();
  // const { id: productId } = params;

  const product = data.products.find((x) => x._id === (id));

  if (!product) {
    return <div> Product Not Found </div>;
  }

  return (
    <div>

      <Link to="/">Back To Result</Link>

      <div className="row top">

        <div className="col-2">

          <img className="large" src={product.image} alt={product.name} ></img>

        </div>

The Main page did render all the images though. Not sure how to find the issue especially when there is no error showing.

screen shot of terminal, web dev tools and the app

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

This is solved thru the suggested solution of @Tomer Almog! Also, thank you @Luigi Remor & @coglialoro for taking the time.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Are you sure that the src is right, look at your project directory and see if it is there "../data". If it exists, look in each object from the list and look if the image is forwarding to the right folder.

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