如何配置 Visual Studio 2015 以使用智能感知在 ASP.NET 5 (RC) 中编写 JSX
How to configure Visual Studio 2015 to write JSX in ASP.NET 5 (RC) with intellisense
我想在 ASP.NET 5(RC) 环境下用 TypeScript 编写 ReactJS 代码,但我在 Visual Studio 2015 中没有智能感知。
我 运行 "tsd install react-global -save " 成功了,但是我还是没有得到 intellisense。
我没用过这个,但这看起来像你要找的东西:Announcing TypeScript 1.6 Beta: React/JSX, better error checking, and more
该页面上有 file for VS2015 to download 并安装。文章引述:
React heavily leverages JSX in everyday code. Unfortunately, the
syntax for JSX conflicted with the cast syntax that TypeScript already
used.
和
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.
因此,如果我没有正确阅读以上内容,您需要安装该文件,然后为您的文件使用扩展名 .tsx,然后 Visual Studio 应该可以正常工作。
我想在 ASP.NET 5(RC) 环境下用 TypeScript 编写 ReactJS 代码,但我在 Visual Studio 2015 中没有智能感知。
我 运行 "tsd install react-global -save " 成功了,但是我还是没有得到 intellisense。
我没用过这个,但这看起来像你要找的东西:Announcing TypeScript 1.6 Beta: React/JSX, better error checking, and more
该页面上有 file for VS2015 to download 并安装。文章引述:
React heavily leverages JSX in everyday code. Unfortunately, the syntax for JSX conflicted with the cast syntax that TypeScript already used.
和
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.
因此,如果我没有正确阅读以上内容,您需要安装该文件,然后为您的文件使用扩展名 .tsx,然后 Visual Studio 应该可以正常工作。