SatelBill
SatelBill

Reputation: 731

typescript extension in VSCode

I just created a sample react-native project with the following command.

react-native init SampleProject --template typescript

Then I got the red line of Editor. How to fix this?

I guess this concerns with extension. What extension should I install for typescript in react-native?

enter image description here

This is the image that I hover mouse on tag. enter image description here

Upvotes: 0

Views: 335

Answers (2)

Vignesh V Pai
Vignesh V Pai

Reputation: 829

I did the following and it worked for me.

yarn add --dev @types/react-native

Upvotes: 1

Devchris
Devchris

Reputation: 412

I recommend using ESLint

Last year TSLint was deprecated in favor of ESLint (TSLint in 2019). TSLint was a valuable project for the TypeScript community and the efforts there were greatly appreciated. The migration from TSLint to ESLint is welcome in being able to leverage more of what the larger JavaScript community has been developing

In addition you should add eslint-plugin-react-native and eslint-plugin-react to your dev dependencies and inside .eslintrc.js (eslint config file) add to the module.exports

plugins: ['react', 'react-native']

Upvotes: 0

Related Questions