Reputation: 1
I try to create a React
project in VS Code. When I try to save index.js
with the HTML tags as below, VS Code breaks my tags and pushes spaces between words and brackets. Can’t find how I can fix it…
// this is before I safe the project
ReactDOM.render( <div> Hello World! </div>, document.getElementById('root'))
// this is after I safe the project
ReactDOM.render( < div > Hello World! < /div>, document.getElementById('root'))
Upvotes: 0
Views: 727
Reputation: 3035
Either:
.js
file extensions to .jsx
."files.associations": {
"*.js": "javascriptreact"
}
Upvotes: 1