typescriptでreact native
npx create-expo-app@latest などでやるとプレビュー版が入って困ったので半手動でやる方法
1.
https://download-directory.github.io/で
https://github.com/expo/expo/tree/main/templates/expo-template-blank-typescript フォルダをダウンロード
2.
package.jsonを下記にする。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
{ "name": "my-expo-template-blank", "description": "The Blank project.", "license": "UNLICENSED", "version": "0.0.1", "main": "index.ts", "scripts": { "start": "expo start --port 19000", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web" }, } |
3.
変えたらCMDで
pnpm i expo
(pnpmで管理するため)
インストールされたら
npx expo install expo-status-bar react react-native
その後
npx expo start
typescript、reactの型をインストールするか聞かれるのでYとする
4.
よく使うライブラリを入れる
npx expo install @react-navigation/native @react-navigation/stack react-native-screens react-native-safe-area-context
5.
その後の更新などは
npx expo install –fix
npx expo install –check