Skip to content

Commit a48cabf

Browse files
committed
fix markdown widget re-rendering on load
1 parent 843503e commit a48cabf

File tree

1 file changed

+1
-11
lines changed
  • src/components/EditorWidgets/Markdown/MarkdownControl/VisualEditor

1 file changed

+1
-11
lines changed

src/components/EditorWidgets/Markdown/MarkdownControl/VisualEditor/index.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,7 @@ export default class Editor extends Component {
4444
}
4545

4646
shouldComponentUpdate(nextProps, nextState) {
47-
return (this.props.value !== null && nextProps.value === null)
48-
|| (this.props.value === null && nextProps.value !== null)
49-
|| !this.state.value.equals(nextState.value);
50-
}
51-
52-
componentWillUpdate(nextProps) {
53-
const shouldResetState = (this.props.value !== null && nextProps.value === null)
54-
|| (this.props.value === null && nextProps.value !== null)
55-
if (shouldResetState) {
56-
this.setState({ value: createSlateValue(nextProps.value) });
57-
}
47+
return !this.state.value.equals(nextState.value);
5848
}
5949

6050
handlePaste = (e, data, change) => {

0 commit comments

Comments
 (0)