mirror of
https://github.com/expo/examples.git
synced 2026-11-15 13:18:12 -10:00
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:
expo init --template expo-template-blank-typescript cdinto the project
Adding TypeScript to existing projects
- Create a blank TypeScript config:
touch tsconfig.json - Run
expo startto automatically configure TypeScript - Rename files to TypeScript,
.tsxfor React components and.tsfor plain typescript files