Created
September 27, 2017 15:15
-
-
Save bitfade/18f16dc056c975f3ede14b8c744b9133 to your computer and use it in GitHub Desktop.
Revisions
-
bitfade created this gist
Sep 27, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ 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()), }); } },