SILENT
SILENT

Reputation: 4268

typescript and @types/react errors

I'm still learning to use typescript with react. Due to how slow react-scripts-ts was, I was turned off from it. I've tried the new typescript setup with babel 7 (react-webpack-typescript-babel) and its exceedingly fast. However there are some basic errors that I can't resolve.

Even though the project runs, in vscode I get the following errors:

I'm assuming this is a @types/react and typescript issue.

  1. Is @types/react not being updated?
  2. How I can get the other properties to show up?
  3. I also don't understand when to download from @types vs use the @types found in some packages other than reading the package description.

Upvotes: 3

Views: 2137

Answers (1)

SILENT
SILENT

Reputation: 4268

Based on @lleon input, an old typescript version was the cause of my headache. I removed it npm un -g typescript, added vscode user setting "typescript.tsdk": "node_modules\\typescript\\lib" and restarted vscode. Works well so far.

Upvotes: 2

Related Questions