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.

JSX - Should we inline single tags

See original GitHub issue

Extracted from https://github.com/prettier/prettier/pull/1831

At the moment the new JSX formatting behaviour doesn’t inline JSX elements contains a single tag.

So this:

<div><a>Click me</a></div>

Is converted to:

<div>
  <a>Click me</a>
</div>

There was some previous discussion about allowing single tags to be inlined (https://github.com/prettier/prettier/pull/1831#discussion_r120167331).

I’ve created this issue as a place for us to continue this discussion.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
k15acommented, Jun 22, 2017

I really like the more clear look of the current behavior even if it is a bit verbose.

2reactions
vjeuxcommented, Jun 22, 2017

I think that always expanding is fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inline Styling with React - Pluralsight
The official React documentation frowns upon the use of inline styling as a primary means of styling projects and recommends the use of...
Read more >
React.js inline style best practices [closed] - Stack Overflow
In inline style tags you can't use media queries or pseudo selectors. Using CSS in JS, you can enjoy the best of both...
Read more >
Why you shouldn't use inline styling in production React apps
One of the reasons why the inline styling is very famous and used is because when a new developer is starting to learn...
Read more >
How To Use Inline Functions In React Applications Efficiently
This blog post explores the performance cost of inline functions in a React application. Before we begin, let's try to understand what inline...
Read more >
HTML vs JSX – What's the Difference? - freeCodeCamp
One of the major differences between HTML and JSX is that in JSX, you must return a single parent element, or it won't...
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