Ad

How To Configure Visual Studio 2015 To Write JSX In ASP.NET 5 (RC) With Intellisense

I want to write ReactJS code in TypeScript with the environment ASP.NET 5(RC),but I am not getting intellisense in Visual Studio 2015.

I run "tsd install react-global -save " successfully, but I still don't get intellisense.

Ad

Answer

I haven't used this, but this looks like what you're looking for: Announcing TypeScript 1.6 Beta: React/JSX, better error checking, and more

There's a file for VS2015 to download and install on that page. Quotes from the article:

React heavily leverages JSX in everyday code. Unfortunately, the syntax for JSX conflicted with the cast syntax that TypeScript already used.

And

In 1.6, we’ve introduced a new .tsx file extension. This extension does two things: it enables JSX inside of TypeScript files, and it makes the new ‘as’ operator the default way to cast. With this, we’ve added full support for working with React/JSX in TypeScript in a type-safe way.

So, if I'm reading the above correctly you need to install that file and then use the extension .tsx for your files and then Visual Studio should work as desired.

Ad
source: stackoverflow.com
Ad