1. 程式人生 > >vscode 'type aliases' can only be used in a .ts file.

vscode 'type aliases' can only be used in a .ts file.

vscode 'type aliases' can only be used in a .ts file.

使用react-native cli生成react-native專案,app.js中報該錯誤

'type aliases' can only be used in a .ts file.

解決方法:

在vscode擴充套件中搜索
@builtin TypeScript and JavaScript Language Features

禁用該擴充套件即可

參考:

https://stackoverflow.com/questions/48852007/type-aliases-can-only-be-used-in-a-ts-file
https://github.com/Microsoft/vscode-react-native/issues/631