Reputation: 731
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?
This is the image that I hover mouse on tag.
Upvotes: 0
Views: 335
Reputation: 829
I did the following and it worked for me.
yarn add --dev @types/react-native
Upvotes: 1
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