From d4553afa1fa5e60f372d853634e8d85b4ab096bc Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Fri, 17 Jan 2014 17:42:40 -0800 Subject: [PATCH] Properly clear live editor on JSX compile failure --- _js/live_editor.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/_js/live_editor.js b/_js/live_editor.js index 5f582b40..e6095cbd 100644 --- a/_js/live_editor.js +++ b/_js/live_editor.js @@ -115,11 +115,9 @@ var ReactPlayground = React.createClass({ compiledCode = this.compileCode(); } catch (err) {} - // we're creating both versions, to avoid the flicker when switching from - // one view to another when CodeMirror recompiles var jsContent =
- {jsxContent} - {jsContent} + {isJS ? jsContent : jsxContent}