-
Notifications
You must be signed in to change notification settings - Fork 63
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
Can't use JSXExpressionContainer as a child #16
Comments
So the fact that there is an error in general makes sense, keep in mind that that desugars to:
Which isn't valid Javascript or JSX - it has to be either:
or (this one I never do but I think it should work?)
However, our transformer should really catch it and throw a nicer error message than that before it gets to Babel. EIther that or I suppose it could check if the first child was a JSX Expression and strip out whatever's inside? Not sure if that leads to any further follow-on problems though. |
(edited the comment above with a code fix and some other thoughts) |
Ah, I see. I was sort of expecting it to desugar into something like I did try it without the Another problem with removing the |
e.g. we wrap all of our user-visible strings for gettext lookup/extraction, so the previous example is more accurately: <If condition={foo}>
{l('foo')}
</If> |
Ah yeah I see how that makes sense. You can work around it for now by wrapping it in |
Wonderful, thanks! :) |
I too am facing a similar issue. I've put |
Fixed by @texttechne in 3.0.0 :) |
I'm using babel 6.2.1 with version 2.0.1 of the plugin. I'd like to do something along the lines of:
Or with any expression that can be enclosed in
{}
. But I get a nasty error instead:The text was updated successfully, but these errors were encountered: