Skip to content
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

jsx Parsing error: Unexpected token do #876

Closed
890f2151c2be69c51db72017546d00fd opened this issue May 4, 2017 · 1 comment

Comments

@890f2151c2be69c51db72017546d00fd
Copy link

commented May 4, 2017

if use do syntax inside jsx https://babeljs.io/docs/plugins/transform-do-expressions/ i get Parsing error: Unexpected token do.

{ do { if (true) { <div></div> } }}

@feross

This comment has been minimized.

Copy link
Member

commented Apr 21, 2018

You can't put that kind of JavaScript syntax in JSX. Only JS expressions. A do or if is not an expression.

@feross feross closed this Apr 21, 2018

@feross feross assigned feross and unassigned feross Apr 21, 2018

@feross feross added the question label Apr 21, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Jul 20, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.