Skip to content

Commit

Permalink
Merge pull request #263 from helloyou2012/patch-1
Browse files Browse the repository at this point in the history
Transform componentWillReceiveProps to componentDidUpdate
  • Loading branch information
jsdf authored Aug 10, 2019
2 parents 78dba8a + 020b999 commit b9000ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions HTMLView.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class HtmlView extends PureComponent {
this.startHtmlRender(this.props.value);
}

componentWillReceiveProps(nextProps) {
if (this.props.value !== nextProps.value || this.props.stylesheet !== nextProps.stylesheet || this.props.textComponentProps !== nextProps.textComponentProps || this.props.nodeComponentProps !== nextProps.nodeComponentProps) {
this.startHtmlRender(nextProps.value, nextProps.stylesheet, nextProps.textComponentProps, nextProps.nodeComponentProps);
componentDidUpdate(prevProps) {
if (this.props.value !== prevProps.value || this.props.stylesheet !== prevProps.stylesheet || this.props.textComponentProps !== prevProps.textComponentProps || this.props.nodeComponentProps !== prevProps.nodeComponentProps) {
this.startHtmlRender(this.props.value, this.props.stylesheet, this.props.textComponentProps, this.props.nodeComponentProps);
}
}

Expand Down

0 comments on commit b9000ba

Please sign in to comment.