Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Last active October 1, 2018 02:58
Show Gist options
  • Save StevenJL/19c08fc589f2294f92692bfcefa330eb to your computer and use it in GitHub Desktop.
Save StevenJL/19c08fc589f2294f92692bfcefa330eb to your computer and use it in GitHub Desktop.
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