Created
June 28, 2019 15:29
-
-
Save xthecapx/42002bed4248584af4ee00cfc64e97de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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