Created
February 24, 2019 11:15
-
-
Save Harshmakadia/e57105dae57f9677263e0e81b03fb9ed to your computer and use it in GitHub Desktop.
Add Update Method
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
// Method to addProductToCart | |
<div> | |
<button | |
onClick={context.addProductToCart.bind(this, product)} | |
> | |
Add to Cart | |
</button> | |
</div> | |
// Method to removeProductFromCart | |
<div> | |
<button | |
onClick={this.context.removeProductFromCart.bind(this,cartItem.id)} | |
> | |
Remove from Cart | |
</button> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment