Skip to content

Instantly share code, notes, and snippets.

@pavel-lens
Created April 19, 2017 16:22
Show Gist options
  • Save pavel-lens/b9f1b2ca412f79bcedd389dc0a1028ee to your computer and use it in GitHub Desktop.
Save pavel-lens/b9f1b2ca412f79bcedd389dc0a1028ee to your computer and use it in GitHub Desktop.
handleApplyClick() {
const { onApplyClick } = this.props
const result = onApplyClick()
// Don't update state if callback is signaling failing behaviour
if (result !== false) {
this.setState({ touched: false })
}
}
handleRevertClick() {
const { onRevertClick } = this.props
const result = onRevertClick()
// Don't update state if callback is signaling failing behaviour
if (result !== false) {
this.setState({ touched: false })
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment