Skip to content

Instantly share code, notes, and snippets.

@andycarrell
Last active February 8, 2017 09:28
Show Gist options
  • Save andycarrell/725e29c315cd957efe448a2bff164b10 to your computer and use it in GitHub Desktop.
Save andycarrell/725e29c315cd957efe448a2bff164b10 to your computer and use it in GitHub Desktop.
class FormWithSomeCouponInput extends React.Component {
constructor(props) { ... }
handleCouponBlur() {
const { coupon, actions } = this.props;
actions.applyBlur('coupon');
actions.submitCoupon({ coupon });
}
handleClearCoupon() {
const { actions } = this.props;
actions.applyChange('coupon', '');
actions.applyBlur('coupon');
actions.submitCoupon({ coupon: '' });
}
render() { ... }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment