25d5321778b04c7fe6a2936cb423b3b648a99a75
TypeScript Example
npx create-react-native-app -t with-typescript
TypeScript is a superset of JavaScript which gives you static types and powerful tooling in Visual Studio Code including autocompletion and useful inline warnings for type errors.
🚀 How to use
Creating a new project
- Install the CLI:
npm i -g expo-cli - Create a project:
npx create-react-native-app -t with-typescript cdinto the project
Adding TypeScript to existing projects
- Create a blank TypeScript config:
touch tsconfig.json - Run
yarn startornpm run startto automatically configure TypeScript - Rename files to TypeScript,
.tsxfor React components and.tsfor plain typescript files
💡 You can disable the TypeScript setup in Expo CLI with the environment variable
EXPO_NO_TYPESCRIPT_SETUP=1 expo start
📝 Notes
Description
Languages
TypeScript
98.2%
JavaScript
1.8%