mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-25 23:05:23 +00:00
use flag to show custom message instead of error
This commit is contained in:
@@ -176,9 +176,16 @@ class CodeEditor extends Component {
|
||||
color: colors.error,
|
||||
padding: 10,
|
||||
}}>
|
||||
{error.message}
|
||||
{!window.Babel &&
|
||||
' (try checking your ad blocker if you have one).'}
|
||||
{this.state.didBabelLoad ? (
|
||||
error.message
|
||||
) : (
|
||||
<span>
|
||||
Babel could not be loaded. This can be caused by ad
|
||||
blockers. If you're using an ad blocker, consider adding
|
||||
reactjs.org to the whitelist so the live code examples
|
||||
will work.
|
||||
</span>
|
||||
)}
|
||||
</pre>
|
||||
</div>
|
||||
)}
|
||||
@@ -277,6 +284,7 @@ class CodeEditor extends Component {
|
||||
console.error(error);
|
||||
|
||||
return {
|
||||
didBabelLoad: !!window.Babel,
|
||||
compiled: null,
|
||||
error,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user