Last active
October 1, 2018 02:58
-
-
Save StevenJL/19c08fc589f2294f92692bfcefa330eb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 PropTypes from 'prop-types'; | |
| const ItemDiv = ({ name, price, purchaseHandler }) => { | |
| return( | |
| <div> | |
| div> Item:{name} </div> | |
| div> Price:${price} </div> | |
| <button onClick={purchaseHandler}> Purchase </button> | |
| </div> | |
| ) | |
| } | |
| ItemDiv.propTypes = { | |
| name: PropTypes.string.isRequired, | |
| price: PropTypes.number.isRequired, | |
| purchaseHandler: PropTypes.func.isRequired | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment