Cannot read property 'params' of undefined react js/ProductScreen.js
Divesh381 opened this issue · 2 comments
Divesh381 commented
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
KTibow commented
- Use code blocks
- Since SVGO isn't directly involved in this I don't see how it's applicable
SethFalco commented
I recommend you head over to Stack Overflow if you're having general programming issues. 👍🏽