Skip to content

Commit 4c60d32

Browse files
committed
fix: infinite loop in special circumstances
1 parent 25574eb commit 4c60d32

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/editor/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,12 @@ class Editor extends React.Component<EditorProps, EditorState> {
157157
value = String(value).toString();
158158
}
159159
value = value.replace(//g, '\n');
160-
this.setState({
161-
text: value,
162-
});
163-
this.renderHTML(value);
160+
if (this.state.text !== value) {
161+
this.setState({
162+
text: value,
163+
});
164+
this.renderHTML(value);
165+
}
164166
}
165167
if (prevProps.plugins !== this.props.plugins) {
166168
this.setState({

0 commit comments

Comments
 (0)