-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
Using template strings throws an error on Safari: Invalid character '`' #4143
Comments
You need to enable the other es6 transforms by adding some params to the I don't know how to trigger that on jsbin but I would suggest using Babel there anyway. |
Thanks for your quick reaction. I was under the impression that ES6 features like template strings where dealt with by the React transformer but if I understand it correctly that's not the case. |
@josdejong It is, but it is not enabled by default. |
Thanks @syranide. I just noticed that babel has support to transform jsx files too (http://babeljs.io/docs/usage/jsx/), and this works right out of the box using a build step. For some reason it didn't work when running the in-browser transform of babel: then html tags in react classes aren't compiled into JavaScript. |
Using template strings in jsx files seems to be not supported by Safari because it doesn't like the backtick character '`'.
On Safari 8, the following code:
Throws an error:
See this jsbin: http://jsbin.com/vurezi/edit?html,js,output
One solution for this is not to use in-browser transformation (which is good practice anyway). But does anybody know a workaround for this? I tried specifying
charset="utf-8"
in the jsx script tags but that didn't help.The text was updated successfully, but these errors were encountered: