From 8a0eda3b6e2835128dd7c2b53b75d05342769124 Mon Sep 17 00:00:00 2001 From: Admir Sabanovic Date: Mon, 16 Oct 2017 21:20:00 +0200 Subject: [PATCH] use callback for setState --- src/components/CodeEditor/CodeEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CodeEditor/CodeEditor.js b/src/components/CodeEditor/CodeEditor.js index 05a8745e..837458a6 100644 --- a/src/components/CodeEditor/CodeEditor.js +++ b/src/components/CodeEditor/CodeEditor.js @@ -312,7 +312,7 @@ class CodeEditor extends Component { } _onChange = code => { - this.setState(this._updateState(code, this.state.showJSX)); + this.setState(state => this._updateState(code, state.showJSX)); }; }