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: Certain inline expressions containing curly braces don't parse correctly #1335

Closed
ericgio opened this issue Mar 6, 2018 · 2 comments
Closed

Comments

@ericgio
Copy link

ericgio commented Mar 6, 2018

It looks like the JSX parser breaks when it encounters curly braces inside an inline function. This is true even if the braces are commented out.

Repro code:

<Button onClick={(e) => this.setState({clicked: true})}>
  Click Me!
</Button>

Screenshot from test page:

image

@ericgio ericgio changed the title JSX: Inline functions containing curly braces don't parse correctly JSX: Certain inline expressions containing curly braces don't parse correctly Mar 6, 2018
@ericgio
Copy link
Author

ericgio commented Mar 6, 2018

Other examples:

Passing an array of objects

<Component
  data={[
    {id: 0, name: 'Joe'},
    {id: 1, name: 'Sue'},
  ]}
/>

image

Template literals (in some cases)

// This works
<Component title={`${name}`} />

// This does not
<Component title={`${name}'s page`} />

image

@Golmote
Copy link
Contributor

Golmote commented Mar 8, 2018

Thanks for reporting! Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants