Reputation: 9905
I installed all recommended extensions, still VSCode won't recognize any React syntax.
What must i do to make VSCode play nice with React (js / jsx) syntax?
Upvotes: 4
Views: 9875
Reputation: 377
This happens because you use some HTML formatter, so first go to your react native or js extension settings(simple click the bottom bar language mod), and check the HTML fomatter in that setting page.
"[html]": {
"editor.defaultFormatter": "apility.beautify-blade"
}
remove this, and you are good to go.
Upvotes: 0
Reputation: 1
1.Delete all html-js-css formatters. 2.If you want to work with this formatters, install prettier. Right click and select format document with and then select prettier. Repeat this every saving.
Upvotes: 0
Reputation: 1640
The plugin that was causing issues for me here actually Babel ES6/ES7 as mentioned in another comment.
Once removing that plugin and reloading, it all worked well
Upvotes: 5
Reputation: 65223
VS Code has built-in support for JSX and TSX. You do not need to install any extensions unless you want additional functionality
As the OP noted, the problem was one of their extensions was inserting spaces around the tags. I suspect it was the js css html formatter
extensions since this has caused problem for people in the past
Upvotes: 4