Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@xthecapx
Created June 28, 2019 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xthecapx/42002bed4248584af4ee00cfc64e97de to your computer and use it in GitHub Desktop.
Save xthecapx/42002bed4248584af4ee00cfc64e97de to your computer and use it in GitHub Desktop.
import React from 'react';
import {products} from './products';
const ProductDetails = ({ name, match }) => {
const { params: { productId }} = match;
const product = products[productId];
return (
<div className="product-deatils">
<h2>Product Details</h2>
<div>
<h3>{ product.name }</h3>
<h4>{ product.price }</h4>
<p>{ product.description }</p>
</div>
</div>
)
};
export default ProductDetails;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment