'I have a problem with react and Visual Studio Code when save
When save in visual studio code using React it breaks everything
Solution 1:[1]
If you have installed JS-CSS-HTML Formatter plug-in effects in your VSCODE, try to remove uninstall it or disable it. Then restart your VSCODE. That's all.
Solution 2:[2]
A quick fix is to press on the bottom right side of the screen where it says "JavaScript", a drop-down menu will be opened, type "rea" for "JavaScript React" and press enter.
It works only for the current file, not even for other files in the same project. for a permanent fix, try one of the other answers.
here is how VS Code documentation explains it:
Changing the language for the selected file - In VS Code, we default the language support for a file based on its filename extension. However, at times you may want to change language modes, to do this click on the language indicator - which is located on the right hand of the Status Bar. This will bring up the Select Language Mode dropdown where you can select another language for the current file.
Tip: You can get the same dropdown by running the Change Language Mode command (Ctrl+K M).
https://code.visualstudio.com/docs/languages/overview

Solution 3:[3]
IMHO, I think that isn't an error, rather it's a warning of prettier, because by default prettier in VSC requires an empty line at the end of your code.
Right click -> Format document
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | TheLastCodeBender |
| Solution 2 | |
| Solution 3 | cnavarreteliz |
