Vscode wrote the react-native code in the wrong format when saving the code.

when writing react-native project files with vscode, the format of the saved code appears as follows:
format before saving:

:

may I ask you how to solve this problem?

Mar.10,2021

I have also encountered this. (after a long time, I forgot how to solve it at that time.) you can see if it is the cause of vscode code testing and plug-ins, or you can find out the reason from the configuration file of the project.


has the problem been solved? I have encountered the same problem


Click-> if javascript, is js, click-> js, configure the associated file and select JavaScript React,
and then in code format


find the JS-CSS-HTML Formatter plugin you downloaded, click diaable (Workspace), and then click reload to solve the problem.

Menu