0
0

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 1 year has passed since last update.

【React学習 #3】React + TypeScriptで環境構築

Posted at

はじめに

この記事はReact初心者の筆者が学習のために書いている記事です。
間違っていたら温かくご指摘いただけるとありがたいです。

HomebrewやNode.jsのインストールについてはこちらの記事で掲載しています。

動作環境

  • PC:Macbook
  • CPU:Intel
  • OS:MacOS Ventura 13.3.1

React + TypeScriptのプロジェクトを作成

React + TypeScriptのプロジェクトを作成するには以下のコマンドを実行します。

cd [プロジェクトを作成する場所]
npx create-react-app [プロジェクト名] --template typescript

完了したら、[プロジェクト名]で指定したフォルダが作成され、その直下に様々なファイル等が格納されます。
また、srcフォルダ配下にはtsxファイルが作成されていることを確認できます。

React + TypeScriptのアプリケーションを実行する。

以下のコマンドを実行して、Reactのアプリケーションを実行します。

cd [プロジェクトの場所]
npm start

このコマンドを実行すると、Webブラウザが開かれ、「 http://localhost:3000/ 」にアクセスします。
動作を確認できたら、ターミナル上で「Ctrl+C」を押して終了します。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?