Skip to content

Instantly share code, notes, and snippets.

@bitfade
Created September 27, 2017 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitfade/18f16dc056c975f3ede14b8c744b9133 to your computer and use it in GitHub Desktop.
Save bitfade/18f16dc056c975f3ede14b8c744b9133 to your computer and use it in GitHub Desktop.
range change
componentDidUpdate: function ( prevProps ) {
// update value state on preview mode change or value changed (via props) by another component
if ((this.props.previewMode && this.props.previewMode !== prevProps.previewMode) || this.props.value !== prevProps.value) {
this.setState({
value: this.emptyIfDefault(this.getCurrentInputValue()),
});
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment