Skip to content

Instantly share code, notes, and snippets.

@xthecapx
Created June 28, 2019 15:28
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/09d0a623d4b9c1993be435a47ec2c303 to your computer and use it in GitHub Desktop.
Save xthecapx/09d0a623d4b9c1993be435a47ec2c303 to your computer and use it in GitHub Desktop.
import React from 'react';
import {products} from './products';
const ProductDetails = ({ name, productId }) => {
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