mk-toolブログ

エンジニアと家のことをごちゃごちゃと書いてます

ReactはNativeでtypescript対応したらしい

下記のQiita記事でReactをTSで開発する時の初期状態を作るコマンドが乗っていた。

ReactとTSの環境を整えるにはReactやTSのパッケージをいれたり、としないといけなかったのに、コマンド一つでプロジェクトを作成することができ、随分と楽になったんだなぁ、と思った。

qiita.com

そこでは、以下のコマンドを実行する、と書いていた。

npx create-react-app rg2-front --scripts-version=react-scripts-ts

しかし、実行してみると、以下のように言われた。

The react-scripts-ts package is deprecated. TypeScript is now supported natively in Create React App. You can use the
 --typescript option instead when generating your app to include TypeScript support. Would you like to continue using r
eact-scripts-ts

なんと、NativeでTS対応をしていると。

以下のコマンドでプロジェクトを作った。良い時代になったな、と思った。

npx create-react-app rg2-front --typescript