Home > Enterprise >  Visual studio code formatting with JSX
Visual studio code formatting with JSX

Time:07-08

When I am working in react native and in react.js, my components are not colored green. I tried going to code > Preferences > Color Theme > and setting it to Dark , but the components are still highlighted blue.

Also when I do the command
⌘ / (to create a comment) it does the javascript way of leaving comments: //this is a comment instead of {/* comment */} .

enter image description here

CodePudding user response:

In the bottom bar where it says Javascript (Babel) if you click that it will give you language options. Select Javascript React instead and you should be good to go.

CodePudding user response:

The shortcut to use multiline comment is Option(⌥) Command (⌘) / or

you could use CMD SHIFT A .

One way to check your shortcuts is to go to

  • Command palette (SHIFT CMD P)
  • Type keyboard shortcuts > Open Keyboard shortcuts
  • In the table look for the keybinding for toggle block comment to find the shortcut.
  • Related