简体   繁体   中英

Default Typescript React-Native project gives 200 errors

I have created a react native project with the following command. VS Code gives about 200 ts errors in the Problems section but I am able to compile with tsc.

npx react-native init MyApp --template react-native-template-typescript

Any idea why VS Code is doing like this? Thanks

do you have eslint installed and enabled?

try npm remove -g eslint and also check your extensions

I am suspecting that you have an incompatible linting extension.


another reason might be vscode identifies *.ts as typescript files and *.tsx as typescript react files. when you open file check bottom right corner of the vscode to see how the file is interpreted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM