Reputation: 481
I just started my first react native with expo and typescript project, I have upgraded my expo and nodejs to the latest version and then run this command
npx create-expo-app -t expo-template-blank-typescript
to generate a new project. however, I have no idea why there are some errors....
like (Type 'boolean' is not assignable to type 'View'.)
and Operator '>' cannot be applied to types '{ styles: any; "": any; }' and 'Text'.
can someone help me?
21/12/2022 updated :
solution: remove Javascript and Typescript Nightly from VSC extensions**
Upvotes: 2
Views: 897
Reputation: 8638
make sure the tsconfig.json file look like this:
{
"extends": "expo/tsconfig.base", // this allow JSX to be used among other things
"compilerOptions": {
// you can set this to false for a more permissive setup
"strict": true,
// set this only for a more permissive ts typechecking
"noImplicitAny": false,
}
}
If that doesn't work:
tsc
command to see if it failsnoImplicitAny
documentation
strict
documentation
Upvotes: 1