Skip to content

Commit

Permalink
RichText: Optimize performance by using strict equality instead of is…
Browse files Browse the repository at this point in the history
…Equal
  • Loading branch information
youknowriad committed Feb 9, 2018
1 parent b357ef0 commit 87ca673
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions blocks/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,14 +691,11 @@ export default class RichText extends Component {
if (
this.props.tagName === prevProps.tagName &&
this.props.value !== prevProps.value &&
this.props.value !== this.savedContent &&
! isEqual( this.props.value, prevProps.value ) &&
! isEqual( this.props.value, this.savedContent )
this.props.value !== this.savedContent
) {
this.updateContent();
}
}

componentWillReceiveProps( nextProps ) {
if ( 'development' === process.env.NODE_ENV ) {
if ( ! isEqual( this.props.formatters, nextProps.formatters ) ) {
Expand Down

0 comments on commit 87ca673

Please sign in to comment.