31
30

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

create-react-app で TypeScript の環境を作る

Posted at

create-react-app を使用すると React 環境が自動生成できるが JavaScript のソースとなる。
TypeScript 環境にするには npm eject で環境を壊し、自身での設定が必要だが --scripts-version=react-scripts-ts オプションを付けることで TypeScript 環境の自動生成が可能だったのでそのメモ。

インストール

npm install -g create-react-app

プロジェクト作成

create-react-app my-app --scripts-version=react-scripts-ts
cd my-app

実行

npm start

http://localhost:3000/ が自動的に開き「Welcom to React」という画面が開けば成功。
image

31
30
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
31
30

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?