No error indicated but the product is not displayed

hi I’m trying to access an array of object like this ( {} ) and get this type of error in reactjs

TypeError: Cannot read property ‘name’ of undefined

here’s the code

import React from "react";
import { Link } from "react-router-dom";
import { Row, Col, Image, ListGroup } from "react-bootstrap";
import Rating from "../components/Rating";
import products from "../products";

function ProductScreen({ match }) {
  const product = products.find((p) => p._id ===;
  return (
      <Link to="/" className="btn btn-light my-3">
        Revenir en Arrière
        <Col md={6}>
          <Image src={product.image} alt={} fluid />
        <Col md={3}>
          <ListGroup variant="flush">

                text={`${product.numReviews} commentaires`}

            <ListGroup.Item>Prix: {product.price}€</ListGroup.Item>

            <ListGroup.Item>Description: {product.description}</ListGroup.Item>

export default ProductScreen;

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.