Skip to content

Instantly share code, notes, and snippets.

@xthecapx
Created June 28, 2019 15:28
Show Gist options
  • Save xthecapx/09d0a623d4b9c1993be435a47ec2c303 to your computer and use it in GitHub Desktop.
Save xthecapx/09d0a623d4b9c1993be435a47ec2c303 to your computer and use it in GitHub Desktop.

Revisions

  1. xthecapx created this gist Jun 28, 2019.
    20 changes: 20 additions & 0 deletions productDetailsReach.jsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    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;