File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,9 @@ var ReactPlayground = React.createClass({
115115 compiledCode = this . compileCode ( ) ;
116116 } catch ( err ) { }
117117
118- // we're creating both versions, to avoid the flicker when switching from
119- // one view to another when CodeMirror recompiles
120118 var jsContent =
121119 < CodeMirrorEditor
122- style = { { display : isJS ? 'inherit' : 'none' } }
120+ key = "js"
123121 className = "playgroundStage CodeMirror-readonly"
124122 onChange = { this . handleCodeChange }
125123 codeText = { compiledCode }
@@ -128,7 +126,7 @@ var ReactPlayground = React.createClass({
128126
129127 var jsxContent =
130128 < CodeMirrorEditor
131- style = { { display : isJS ? 'none' : 'inherit' } }
129+ key = "jsx"
132130 onChange = { this . handleCodeChange }
133131 className = "playgroundStage"
134132 codeText = { this . state . code }
@@ -154,8 +152,7 @@ var ReactPlayground = React.createClass({
154152 </ div >
155153 </ div >
156154 < div className = "playgroundCode" >
157- { jsxContent }
158- { jsContent }
155+ { isJS ? jsContent : jsxContent }
159156 </ div >
160157 < div className = "playgroundPreview" >
161158 < div ref = "mount" />
You can’t perform that action at this time.
0 commit comments