Add option for parentheses around JSX.
See original GitHub issueI think prettier should have an option ~for TypeScript~ to omit JSX parentheses.
Instead of this:
public render(): JSX.Element {
return (
<div>
<div>Hello world!</div>
</div>
);
}
Expected behavior:
public render(): JSX.Element {
return <div>
<div>Hello world!</div>
</div>;
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:107
- Comments:35 (6 by maintainers)
Top Results From Across the Web
Why is it best practice to surround JSX assigned to variables ...
The usual reasons to add parentheses are either to override default operator precedence (not necessary here if the results are the same), or ......
Read more >React, Part I: JSX Cheatsheet - Codecademy
A JSX expression that spans multiple lines must be wrapped in parentheses: ( and ) . In the example code, we see the...
Read more >putting parentheses inside jsx breaks syntax : WEB-46905
add a parentheses to the root "div" const Test = () => ( <div>()</div> ) ... this is valid JSX - babel transpiles...
Read more >When should I use curly braces { } and parenthesis ( ) in React?
Curly braces { } are special syntax in JSX. It is used to evaluate a JavaScript expression during compilation. A JavaScript expression can...
Read more >Options - Prettier
JSX Quotes. Use single quotes instead of double quotes in JSX. ... However, when Prettier removes parentheses, it becomes harder to add type...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
SIGNIFICANT DEMAND TOO!
SIGNIFICANT DEMAND! xD