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.

Wrong .tsx formatting with fragments

See original GitHub issue

this code

import React from "react";

const Buddies = () => <>Buddies</>;
export default Buddies;

after saving becomes this

import React from "react";

const Buddies = () => <>"uddie"</>;
export default Buddies;

if i use a div instead of a fragment it works ok

prettier ran from command line works ok too

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
HVishcommented, Jun 24, 2019

I am also facing same issue! Following code:

<><div>abc</div></>

becomes:

<>
  ' \' \' \' \' '<div>abc</div>' '
</>
0reactions
github-actions[bot]commented, Apr 12, 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

Wrong TSX ternary markup block formatting in VSCode
When I run prettier --write src/components/TestComponent.tsx the tsx file is formatted correctly. I also checked typescript-specific formatting ...
Read more >
JSX Fragment Syntax in TypeScript - Marius Schulz
</> syntax to create a fragment. #Motivation Behind JSX Fragments. In React, it's a common pattern to return multiple elements from a component....
Read more >
How to configure Prettier and VSCode - Gleb Bahmutov
Code formatting is wrong. Here is a little animation that shows a file being saved with Prettier setting "trailingComma: true", yet the comma ......
Read more >
Setting TypeScript For Modern React Projects Using Webpack
This article introduces Typescript, a superscript of JavaScript that presents the static type feature for spotting common errors as ...
Read more >
Storybook - An alternative approach - Paul Scanlon
I find this format less useful if the component is part of a ... Storybook does work with .tsx files out of the...
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