Visual studio code changes format (React-JSX)

后端 未结 12 1051
难免孤独
难免孤独 2020-12-12 13:45

I\'ve the following snippet in my index.js

class App extends Component {
    render() {
        return ( 
Welc
12条回答
  •  生来不讨喜
    2020-12-12 14:12

    You can prevent VSC from incorrectly formatting your JSX by adding an association in your settings.json

    Code > Preferences > Settings

    In the settings window search for associations, click edit in settings.json and then add:

    "files.associations": {
        "*.js": "javascriptreact"
    }
    

提交回复
热议问题