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

Curly braces are pointless and ugly #11944

Closed
ghost opened this issue Jan 2, 2018 · 2 comments
Closed

Curly braces are pointless and ugly #11944

ghost opened this issue Jan 2, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 2, 2018

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
Curly braces are required to delimit Javascript expressions in JSX attributes.

<MyComponent foo={bar(1, 2, 3)} />

What is the desired behavior?
All Javascript expressions can be expressed without the need for {}.

<MyComponent foo=bar(1, 2, 3) baz="quirk" life=42 pi=3.1415 sum=(x + y) fancy=`Hello ${name}` onClick=()=>{ this.andThat() } />

In short, requiring {} around all of these is unnecessary although the last one is a bit ugly with the =()=> thing.

@gaearon
Copy link
Collaborator

gaearon commented Jan 2, 2018

This is not a React issue, but a JSX one. Let’s keep track of it in the right repository.

facebook/jsx#25
facebook/jsx#51
facebook/jsx#64

@gaearon gaearon closed this as completed Jan 2, 2018
@ghost
Copy link
Author

ghost commented Jan 2, 2018

Thanks for the pointer.

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

No branches or pull requests

1 participant