1

Can anyone tell me how to comment JSX code in VSC?

I looked at the articles listed at the bottom, none of them seem to give a concrete solution, and the ticket appeared to have been closed, claiming that the commenting/uncommenting function has been properly resolved on VSC. However, I am still having troubles after trying out the followings as suggested:

  1. disable sublime-babel extension on VSC
  2. Update my language to Javascript react
  3. In user setting, added the followings:

    "emmet.syntaxProfiles": { "javascript": "jsx" },

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

Any clue would be really appreciated. Exhaused all tricks. Thanks!

How to you comment jsx code out in .js files in VSCode?

https://github.com/Microsoft/vscode/issues/6461

Gama11
  • 31,714
  • 9
  • 78
  • 100
geekydude703
  • 187
  • 1
  • 1
  • 13

4 Answers4

1

Select the text to be commented then press Ctrl+K and Ctrl+C.

heyitsvajid
  • 1,023
  • 1
  • 10
  • 19
0

Did you try to install React or Babel plugin?

Matt
  • 8,195
  • 31
  • 115
  • 225
0

This might sound dumb but, have you tried re-installing VSCode? Commenting out JSX in a .js file works fine for me without any plugins. (I use windows)

Michael Sorensen
  • 1,850
  • 12
  • 20
0

I was having this issue and for me the problem was the extension Babel ES6/ES7. I've uninstalled that extension.

If that doesn't help you could try changing the Language Mode to JavaScript React