How to comment JSX code out in .js files in VSCode?

前端 未结 16 868
天涯浪人
天涯浪人 2020-12-02 18:02

Unlike in webstorm, I\'m unable to comment JSX code out in .js files in the Visual Studio Code.

16条回答
  •  孤街浪徒
    2020-12-02 18:33

    I had the same issue until I converted the file language to Typescript React (typescriptreact).

    If you want to configure this as the language for all .js files, add this to your settings.json (either globally, or at a project-level in /.vscode/settings.json).

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

提交回复
热议问题