Skip to content

Commit 8a0eda3

Browse files
authored
use callback for setState
1 parent 9876647 commit 8a0eda3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/CodeEditor/CodeEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class CodeEditor extends Component {
312312
}
313313

314314
_onChange = code => {
315-
this.setState(this._updateState(code, this.state.showJSX));
315+
this.setState(state => this._updateState(code, state.showJSX));
316316
};
317317
}
318318

0 commit comments

Comments
 (0)