File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/components/CodeEditor Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -176,9 +176,16 @@ class CodeEditor extends Component {
176
176
color : colors . error ,
177
177
padding : 10 ,
178
178
} } >
179
- { error . message }
180
- { ! window . Babel &&
181
- ' (try checking your ad blocker if you have one).' }
179
+ { this . state . didBabelLoad ? (
180
+ error . message
181
+ ) : (
182
+ < span >
183
+ Babel could not be loaded. This can be caused by ad
184
+ blockers. If you're using an ad blocker, consider adding
185
+ reactjs.org to the whitelist so the live code examples
186
+ will work.
187
+ </ span >
188
+ ) }
182
189
</ pre >
183
190
</ div >
184
191
) }
@@ -277,6 +284,7 @@ class CodeEditor extends Component {
277
284
console . error ( error ) ;
278
285
279
286
return {
287
+ didBabelLoad : ! ! window . Babel ,
280
288
compiled : null ,
281
289
error,
282
290
} ;
You can’t perform that action at this time.
0 commit comments