Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No intellisense for React in Visual Studio 2015

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.

like image 300
wonderful world Avatar asked Aug 19 '15 11:08

wonderful world


People also ask

Can you use React in Visual Studio?

React is a popular JavaScript library developed by Facebook for building user interfaces. The Visual Studio Code editor supports React.

What languages does Visual Studio Code Intellisense support?

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.

Why is my Visual Studio IntelliSense not working?

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.

When did Microsoft IntelliSense come out?

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.

What is IntelliSense in VS Code?

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.


1 Answers

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.

like image 162
Steven Blom Avatar answered Oct 20 '22 05:10

Steven Blom