-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Mention ad blockers when Babel is not defined #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mention ad blockers when Babel is not defined #158
Conversation
@@ -177,6 +177,7 @@ class CodeEditor extends Component { | |||
padding: 10, | |||
}}> | |||
{error.message} | |||
{!window.Babel && ' (try checking your ad blocker if you have one).'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it also ask the user to whitelist the website?
Deploy preview ready! Built with commit 26c975d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this new wording is actionable enough as is. (I worry that a user wouldn't know to whitelist reactjs.org if they want the live code examples to work.) How do you feel about wording more like:
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.
I also wonder if it might be a little cleaner to detect this error condition in _updateState
(within the try
/catch
) and set a flag in state to show the special Babel message (rather than having the inline conditional in render).
Sure, so the special message should be shown instead of "Babel is not defined", right? |
Yeah, that's what I was thinking- we could check this state-flag and render some custom text instead of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
* Translated Community/Courses; * Added ReactJS Ninja in Paid Courses.
Closes #3.