Skip to content

Instantly share code, notes, and snippets.

@fcsonline
Created December 2, 2016 11:53
Show Gist options
  • Save fcsonline/496bb9babbbff7b16ccb9bad96901850 to your computer and use it in GitHub Desktop.
Save fcsonline/496bb9babbbff7b16ccb9bad96901850 to your computer and use it in GitHub Desktop.
Cart - CartItem
class CartItem extends React.Component {
onClickRemove () {
// Go to your store and remove item
}
render() {
const { item } = this.props;
const isPremium = item.premium ? 'premium' : '';
return (
<div className={isPremium}>
<header>{item.title}</header>
<p>{item.description}</p>
<button onClick={this.onClickRemove}>Remove from cart</button>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment