{
"$type": "site.standard.document",
"canonicalUrl": "https://blog.nove-b.dev//posts/integrate-typescript-react-native",
"path": "/posts/integrate-typescript-react-native",
"publishedAt": "2023-09-15T00:00:00.000Z",
"site": "at://did:plc:2atly2y5kfyjcj5zap6pv4wd/site.standard.publication/3mmxeqr2tcb2k",
"tags": [
"react-native",
"typescript"
],
"textContent": "TypeScript 関係をインストールする。\n\n上記コマンドでTypeScriptの依存パッケージをインストールする。\n\n完了するとPackage.jsonが\n\nから\n\nに更新される。\n\ntsconfig.jsonを作成する\n\nAppのルートにtsconfig.jsonを作成し、\n\nを記述する。\n\nTsxファイルの作成と動作確認\n\n最後にJavascriptファイルを*.tsxに変換する。\n\n> You should leave the ./index.js entrypoint file as it is otherwise you may run\n> into an issue when it comes to bundling a production build.\n\nと公式に書かれていたが、そもそもindex.jsを見つけることができなかったからドキュメントが古い?\n\nApp.tsxに型のない関数を書くとtsエラーが出たので、うまく機能していると思われる。\n\nまた無事にAppを開けたので、動作も問題ない。\n\nちなみに、\n\nを使えば初期のApp作成時にTypeScriptを導入できるので、こっちでやるべきだった。\n\n参考Using TypeScript",
"title": "React NativeにTypeScriptを導入する"
}