Home > Software design >  TS message in React Native and React
TS message in React Native and React

Time:09-23

I made two projects, in my react project with npx, whenever i dont use typescript(where is supose to be) i get an error message:

enter image description here

enter image description here

and in my React Native project with expo, i dont get any messages

enter image description here

How can i set my react native project to send me this error message from typescript?

My react-native tsconfig.json:

{
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true
  }
}

CodePudding user response:

You just need to add typescript to your expo managed project. Have a look at the official docs on how to do it.

CodePudding user response:

In my function i used const Home: React.FC = () =>, if you use React.FC all the things inside () are typed, so i used function Home(){ and it worked.

  • Related