Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up jsx syntax highlight and Intellisense in Visual Studio Code 1.5.2?

I'm new to Reactjs and I'm trying to configure VSCode for react and jsx.

The available information seems outdated... I managed to configure reactjs in VScode.

I installed the following extensions:

  • Typings Installer
  • Typings
  • Babel ES6/ES7
  • Reactjs Code Snippets
  • jsx by TwentyChung

VSCode Language mode now shows "Javascript React".

What I can't get to work is react-jsx syntax highlight and intellisense. What am I missing? Are there any instructions about jsx configuration?

Windows 10 64, VSCode 1.5.2, react files in .js

Thanks,

Enrico

like image 567
DoctorC Avatar asked Nov 09 '22 08:11

DoctorC


2 Answers

VS Code supports JSX syntax highlighting and IntelliSense out of the box. It also supports features like auto-closing tags and auto imports for JSX

You do not need to install extensions. Many of the ones referenced in the question will actually cause problems and are not actively being maintained

like image 70
Matt Bierner Avatar answered Nov 14 '22 23:11

Matt Bierner


I'm not contradicting the previous answer, but it's also worth noting that this issue is currently open because VS Code is not highlighting syntax or formatting code for text/jsx blocks inside HTML files. At the time of writing, there is a PR open (linked from the issue) which will hopefully fix the issue but it has not yet been merged.

like image 34
Dawngerpony Avatar answered Nov 14 '22 21:11

Dawngerpony