I used to have the same problem. Apparently beautify doesn't support JSX. I uninstalled and instead of it, I installed Prettier, it works great for me.
Hope I helped you.
Answer from Carlos Emiliano Castro Trejo on Stack OverflowI used to have the same problem. Apparently beautify doesn't support JSX. I uninstalled and instead of it, I installed Prettier, it works great for me.
Hope I helped you.
Just change language mode javascript to javascript react [temporary]
VSCode Command: (Ctrl + KM)
Or Save file in .jsx format and change the settings.json file
"files.associations": {
"*.jsx": "javascriptreact"
}
Videos
Is This React Code Beautifier Free to Use?
Do I Need to Install Anything to Use This Beautifier?
What is React formatter?
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.