I don't see any intellisense for ReactJS, for example methods like React.createClass although I see _references.js file at the root folder. The _references.js file has help reference to various react js files.
The extension of my react file is JS and not JSX.
React is a popular JavaScript library developed by Facebook for building user interfaces. The Visual Studio Code editor supports React.
Visual Studio Code IntelliSense is provided for JavaScript, TypeScript, JSON, HTML, CSS, SCSS, and Less out of the box. VS Code supports word based completions for any programming language but can also be configured to have richer IntelliSense by installing a language extension. Below are the most popular language extensions in the Marketplace.
If your Visual Studio IntelliSense is malfunctioning due to one of those, this might be just what you need. If all of the above didn’t work, it’s time to verify some configurations in Visual Studio itself.
Microsoft first introduced it in 1996, but they based the tool on a lot of existing concepts of automatic code completion and syntax checking. In the most recent versions of the Visual Studio IDE, IntelliSense kicks in when the user starts typing, instead of requiring some special procedure or particular characters.
IntelliSense features. VS Code IntelliSense features are powered by a language service. A language service provides intelligent code completions based on language semantics and an analysis of your source code. If a language service knows possible completions, the IntelliSense suggestions will pop up as you type.
I fixed this issue by importing the NuGet package "react.js" and bringing the script locally.
I've also added a _references.js
to ~/Scripts/ to my project. Visual Studio had a helper under "add..." entitled "_references.js intellisense file" which looked like this:
/// <autosync enabled="true" />
/// <reference path="bootstrap.js" />
/// <reference path="jquery-2.1.4.js" />
/// <reference path="react/jsxtransformer-0.13.1.js" />
/// <reference path="react/react-0.13.1.js" />
/// <reference path="react/react-with-addons-0.13.1.js" />
After that, I was able to use intellisense in my jsx files. The _references.js file did not seem to like running from Facebook's CDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With