-
Notifications
You must be signed in to change notification settings - Fork 465
Unnecessary braces when autocompleting JSX props #7341
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
Comments
I actually prefer having curly braces, mostly because of how it is in React JS. |
Yeah this is actually intentional, and it's to be uniform (can always have braces, can not always not have braces). Plus, make it easier to change the expression. If you add a pipe to |
In my perception, this just adds visual noise. But if we want to standardize on having the braces because that's how it is in React JS, then maybe <MyComponent x=AAAAA actually should be reformatted to <MyComponent x={AAAAA} ? |
I can add this to the formatter to always add braces if we decided that we should do it this way. |
I prefer not to have curly braces if I don't need them, and JS React also has something similar with strings compared to template literals. <Foo name="Joe" />
<Bar name={`${firstname} ${lastname}`} /> To me this seems like a precedent that in React curly braces are only used when required, and if in ReScript there are more cases where we can omit them, we should. |
I agree that curly braces shouldn't be added if they are not necessary (but the formater should keep them if you prefer to write them) |
Example:
Autcomplete correctly suggests
AAAAA
andBBBBB
. When I selectAAAAA
, I getThe braces are unnecessary here, so I usually remove them again manually to get
The text was updated successfully, but these errors were encountered: