Hi there,
Is there a preferred formatter for React that you use? I have Prettier but it does not work as well-perhaps a settings issue? Thx
In the end what did the trick was changing the file format from JavaScript to JavaScript React on the bottom toolbar. I'm publishing it here for future reference since I didn't find any documentation on this topic.

In addition to the above. If you click 'Configure File Association for .js' you can set all .js files to Javascript React
change vscode preferences settings > user settings below:
"files.associations": {
"*.js":"javascriptreact"
}
Recommended VSCode plugins for React development?
Not specific to react, but a must have:
Prettier (highly recommended)
Bracket Pair Colorizer
Built-in support for HTML and JS are pretty good in vscode.
More on reddit.comBest formatter/beautify extension you know of that supports largest selection of languages?
The Best VS Code React Extensions 2022
VSCode formatter for React?
Videos
Follow these steps:
CTRL + SHIFT + P- Format Document (in pop-up bar)
- Select
Format Document - Select
Configure Default Formatter... - Select
Prettier - Code formatter
To enable Format On Save
CTRL + SHIFT + P- Preferences Open Settings (UI) (in pop-up bar)
- Type
Format On Save - Enable
Format On Saveif it is not checked
Done!
I have had the same issue, even thus I have installed the Prettier extension. It shows later that I have had another extension called JS-CSS-HTML Formatter. I uninstalled JS-CSS-HTML Formatter and kept Prettier, and all problem was solved.
This issue is mentioned here as well.