question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can self-closing JSX end in last line instead of a new line?

See original GitHub issue

Input: <View a={true} b={false} />

Actual Output:

<View 

        a={true} 

        b={false} 

/>

Expected Output

<View 

        a={true} 

        b={false} />

Is there an option to control this closing format?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
booker-laputacommented, Feb 5, 2018

jsxBracketSameLine is for opening bracket

jsxBracketSameLine === true

<Text
    style={...}>
    TEXT_HERE
</Text>

jsxBracketSameLine === false

<Text
    style={...}
    >
    TEXT_HERE
</Text>
0reactions
github-actions[bot]commented, Apr 13, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Closing > in new line - visual studio code - Stack Overflow
How to make label starting tag '>' in the same line as last attribute? I use Prettier, but I neither couldn't find solution...
Read more >
Allow reformat to place closing tag in new line in JSX - YouTrack
IntelliJ wraps long lines which is good, but it keeps the closing tag, if there's room for it, along with the rest of...
Read more >
Self-Closing Tag | React
In JSX, <MyComponent /> alone is valid while <MyComponent> isn't. All tags must be closed, either with the self-closing format or with a...
Read more >
JSX In Depth - React
You can also use the self-closing form of the tag if there are no children. So: ... JSX removes whitespace at the beginning...
Read more >
React.js br Tag and AJAX Request - Pluralsight
In React, you use the self-closing <br> tag to produce a line break between the text or a section, whereas in HTML you'd...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found