Merge pull request #158 from renanpvaz/improve-adblocker-related-error-message

Mention ad blockers when Babel is not defined
This commit is contained in:
Brian Vaughn
2017-10-17 09:12:34 -07:00
committed by GitHub

View File

@@ -197,7 +197,16 @@ class CodeEditor extends Component {
color: colors.error,
padding: 10,
}}>
{error.message}
{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>
)}
@@ -305,6 +314,7 @@ class CodeEditor extends Component {
console.error(error);
return {
didBabelLoad: !!window.Babel,
compiled: null,
error,
};