问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/32094173/no-intellisense-for-react-in-visual-studio-2015