Cityonhill93
Cityonhill93

Reputation: 83

@Types/React Build Error

I have a MVC project that I am working on which uses typescript. In order to get access to the types. I also use React. In order to get the react types, I did an npm install --save-dev @types/react (same thing for react-dom). However, when I build (both locally and on my TFS server) I get errors in the .d.ts file for react. I have spent hours looking at this and need some help on what I need to look at. This is a non-work project, so if you need access to the full project, then I could provide that for you.

--Edit

Some of the error messages include

Upvotes: 0

Views: 712

Answers (1)

basarat
basarat

Reputation: 276235

The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type

You cannot write JSX in a .ts file. Please use a .tsx file extension

More

https://basarat.gitbooks.io/typescript/content/docs/jsx/tsx.html

Upvotes: 2

Related Questions