Skip to content

Commit

Permalink
Remove deprecated componentWillReceiveProps from TinyMCE component (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Nov 1, 2018
1 parent de7121c commit 9c8923a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/editor/src/components/rich-text/tinymce.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,7 @@ export default class TinyMCE extends Component {
this.initialize();
}

shouldComponentUpdate() {
// We must prevent rerenders because TinyMCE will modify the DOM, thus
// breaking React's ability to reconcile changes.
//
// See: https://github.com/facebook/react/issues/6802
return false;
}

componentWillReceiveProps( nextProps ) {
shouldComponentUpdate( nextProps ) {
this.configureIsPlaceholderVisible( nextProps.isPlaceholderVisible );

if ( ! isEqual( this.props.style, nextProps.style ) ) {
Expand All @@ -155,6 +147,12 @@ export default class TinyMCE extends Component {
this.editorNode.removeAttribute( key ) );
updatedKeys.forEach( ( key ) =>
this.editorNode.setAttribute( key, nextProps[ key ] ) );

// We must prevent rerenders because TinyMCE will modify the DOM, thus
// breaking React's ability to reconcile changes.
//
// See: https://github.com/facebook/react/issues/6802
return false;
}

componentWillUnmount() {
Expand Down

0 comments on commit 9c8923a

Please sign in to comment.