svg/svgo

Cannot read property 'params' of undefined react js/ProductScreen.js

Divesh381 opened this issue · 2 comments

This is not working

import React from 'react';
import { Link} from 'react-router-dom';
import { Row,Col,Button,Image,ListGroup,Card } from 'react-bootstrap';
import products from '../../products';

function ProductScreen({match}) {
const product = products.find((p) => p._id ===match.params.id); //dynamic route parameter
return (


{product.name}



)
}
export default ProductScreen

  1. Use code blocks
  2. Since SVGO isn't directly involved in this I don't see how it's applicable

I recommend you head over to Stack Overflow if you're having general programming issues. 👍🏽