Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda