eliminate unnecessary editor renders
This commit is contained in:
parent
de1e36108d
commit
28ee67c35e
@ -14,6 +14,13 @@ export default class RawEditor extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
if (this.state.editorState.equals(nextState.editorState)) {
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
handleChange = editorState => {
|
||||
this.setState({ editorState });
|
||||
}
|
||||
|
@ -255,6 +255,13 @@ export default class Editor extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
if (this.state.editorState.equals(nextState.editorState)) {
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
handlePaste = (e, data, state) => {
|
||||
if (data.type !== 'html' || data.isShift) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user