Wrong .tsx formatting with fragments
See original GitHub issuethis 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:
- Created 5 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
I am also facing same issue! Following code:
becomes:
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.