0
4

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のフォルダ構成

Posted at

Reactは、Facebookが開発したJavaScriptライブラリで、主にシングルページアプリケーション(SPA)の開発に使用されます。
Reactのプロジェクトを作成し、管理する際の一部はフォルダ構成に関連します。

今回は、そのReactの基本的なフォルダ構成について簡潔に説明します。

Reactの基本的なフォルダ構成

Reactの基本的なフォルダ構成は以下のようになります。

/my-app
├── node_modules/
├── public/
│   ├── index.html
│   ├── favicon.ico
│   └── manifest.json
├── src/
│   ├── App.js
│   ├── index.js
│   └── (other components)
├── package.json
└── README.md

それぞれの役割を簡単に説明します。

  • node_modules/:プロジェクトで使用するnpmパッケージがインストールされるディレクトリです。ここには直接ファイルを編集することはほとんどありません。

  • public/:静的なファイルが置かれます。index.htmlは、ReactアプリケーションのエントリーポイントとなるHTMLファイルです。favicon.icoはウェブサイトのアイコンで、manifest.jsonはPWA(Progressive Web App)設定のためのファイルです。

  • src/:ReactのコンポーネントやJavaScriptのソースコードが置かれるディレクトリです。App.jsはメインのReactコンポーネント、index.jsはReactアプリケーションのエントリーポイントのJavaScriptファイルです。

  • package.json:プロジェクトの設定ファイルです。ここには、プロジェクトに必要なnpmパッケージとそのバージョンが記録されます。

  • README.md:プロジェクトに関する情報を説明するドキュメントです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?