Skip to content
Advertisement

React intellisense in Visual Studio Code

I’m sure I’m missing something simple, but I simply can’t get React.js IntelliSense to work in Visual Studio code.

I have done the following:

  • npm install typings
  • ext install Typings Installer in Visual Studio Code
  • ext install Typings in Visual Studio Code
  • typings init in the root directory of my “app”
  • typings install --ambient react-global in the root of my “app”
  • restarted Visual Studio Code

That’s created a typings folder. My app is structured in the following folder structure:

├───public
│   ├───css
│   └───scripts
|       └───test.js
└───typings
    ├───browser
    │   └───ambient
    │       └───react-global
    └───main
        └───ambient
            └───react-global

Yet when I’m in test.js and type React. I get no IntelliSense.

I presume I’m missing something fundamental?

Advertisement

Answer

You need to add jsconfig.json to the root of your workspace

https://code.visualstudio.com/docs/languages/javascript#_javascript-projects-jsconfigjson

[Note: you can even leave the jsconfig.json file empty]

Advertisement