简体   繁体   中英

Visual Studio Code is changing HTML after saving (React)

I started to learn react. A few minutes later messed up. I was looking for a setting and somehow I come where else where i selected a different choice(something like NodeJS)...now my problem is:

First Image

在此处输入图像描述

Second Image

在此处输入图像描述

First image is what I wrote. Second image is what it became after saving(CTRL + S).

Third Image在此处输入图像描述 This third image is the changed original template...

I tried to reinstall VS Code and deleting the settings(user/json) file nothing has changed. Does anyone know how to fix this problem.

Any help is appreciated :P

我也遇到了这个错误尝试将js文件重命名为jsx

their is different formatter for react. but for instant fix just disable auto formating on save from vscode setting.

在此处输入图像描述

On the status bar of VS Code, you would see the language that has been set automatically to your file where to find the language mode

click on the name of the language and it would take you to this section language mode

Type the language you want to use for that first and select it or You can select configure file association for '...' and type the language you want to use.(This changes the language forever unless you decide to change it)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM