Inconsistency in single line jsx components
See original GitHub issueHere is a single line component, wrapped in parentheses: prettier playground
const FormError = ({ error }) => (
<p>I am a very very very very very very long text</p>
)
Here is the same component with another contents, the parentheses are gone: prettier playground
const FormError = ({ error }) =>
error || <p>I am a very very very very very very long text</p>
Prettier 1.6.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
inconsistent value of input in react when removing dom
1 bug for sure is that when you are setting the ID of the items to the length. So if you add 2,...
Read more >8 common React error messages and how to address them
React Hook useXXX is called conditionally. React Hooks must be called in the exact same order in every component render; React Hook has...
Read more >Concurrent UI Patterns (Experimental) - React
The tradeoff we're making here is that <ProfileTimeline> will be inconsistent with other components and potentially show an older item. Click “Next” a...
Read more >FormControl API - Material UI - MUI
API reference docs for the React FormControl component. Learn about the props, ... You can find one composition example below and more going...
Read more >Rationale - Prettier
JSX takes its roots from HTML, where the dominant use of quotes for attributes is ... Prettier collapses multiple blank lines into a...
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
Another possible solution:
Just to isolate, thoughts on this?