Skip to content

Commit 169754f

Browse files
committed
refactor: tweak to use the _updateState method
1 parent d83238c commit 169754f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/components/CodeEditor/CodeEditor.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ class CodeEditor extends Component {
3636
if (prevState.compiled !== this.state.compiled) {
3737
this._render();
3838
} else if (this.props.code !== prevProps.code) {
39-
this.setState({
40-
code: this.props.code,
41-
});
39+
this.setState(this._updateState(this.props.code));
4240
}
4341
}
4442

0 commit comments

Comments
 (0)