@Types/React 构建错误
@Types/React Build Error
我有一个正在使用 typescript 的 MVC 项目。为了获得对类型的访问。我也使用 React。为了获得反应类型,我做了一个 npm install --save-dev @types/react (对于反应-dom 也是一样)。但是,当我构建时(在本地和我的 TFS 服务器上),我在 .d.ts 文件中收到错误消息以进行反应。我花了几个小时看这个,需要一些帮助来了解我需要看的东西。这是一个非工作项目,所以如果您需要访问完整项目,那么我可以为您提供。
--编辑
一些错误消息包括
- 算术运算的右边必须是'any'、'number'或枚举类型
- ',' 预期
- '>' 预计
- 预期的表达式
- 命名空间 'React' 没有导出成员 'SVGProps'。
- 命名空间 'React' 没有导出成员 'DetailedHTMLProps'。
The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type
您不能在 .ts
文件中编写 JSX。请使用 .tsx
文件扩展名
更多
https://basarat.gitbooks.io/typescript/content/docs/jsx/tsx.html
我有一个正在使用 typescript 的 MVC 项目。为了获得对类型的访问。我也使用 React。为了获得反应类型,我做了一个 npm install --save-dev @types/react (对于反应-dom 也是一样)。但是,当我构建时(在本地和我的 TFS 服务器上),我在 .d.ts 文件中收到错误消息以进行反应。我花了几个小时看这个,需要一些帮助来了解我需要看的东西。这是一个非工作项目,所以如果您需要访问完整项目,那么我可以为您提供。
--编辑
一些错误消息包括
- 算术运算的右边必须是'any'、'number'或枚举类型
- ',' 预期
- '>' 预计
- 预期的表达式
- 命名空间 'React' 没有导出成员 'SVGProps'。
- 命名空间 'React' 没有导出成员 'DetailedHTMLProps'。
The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type
您不能在 .ts
文件中编写 JSX。请使用 .tsx
文件扩展名
更多
https://basarat.gitbooks.io/typescript/content/docs/jsx/tsx.html