-
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
Escaping curly brackets #1545
Comments
You bring up a valid issue. While escaping with a back-slash would be possible, it could introduce far more serious issues. What if you actually want a The simplest solution and the one I'm pretty certain the devs will advocate as well is |
Yeah, quoting as a plain JS string is the way to do it. Let us know if this poses a problem for you somehow. |
Hey Spicyj, sadly it makes
|
@RickWong If you really want have inline |
Hehe, it's inline but it makes the component self-contained. It's almost comparable to how JSX is inline HTML. My work around does utilize Problem with the other solution |
Nope, it looks like it works in |
Old topic but I think JS string literals are actually a valid solution to this problem. Also I solved it by putting them all in a "sheet" prop that I use instead of "children". See https://github.com/RickWong/ReactStyle |
Related facebook/jsx#28 |
FWIW, for anyone stumbling upon this issue while searching for a solution, the simplest (assuming ES6) is probably: <style>{`
.spinner ellipse { opacity: 0; }
/*...*/
`}
</style> |
In webstorm atleast
|
Please file an issue with WebStorm, I'm sure they'd be happy to fix. cc @prigara |
Hi, @timuric! Here's a related issue on our tracker: https://youtrack.jetbrains.com/issue/WEB-21774 Hope we'll get it fixed soon. |
If you happen to be generating JSX like me, this seems to work:
Or maybe this fun little regex:
|
JSX |
my solution, define the whole string outside
|
In my opinion, it would make a lot of sense to be able to escape with |
Thanks for React and JSX!
Would it be possible to escape curly brackets in the future? Like this:
The text was updated successfully, but these errors were encountered: