本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペースはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらく

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシープライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
012345678901234567890123456789012345678901234567890123456789
昨日
012345678901234567890123456789012345678901234567890123456789
累計閲覧
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

React ドキュメント
React
Getting Started with ReactProject StructureCore ConceptsData and StateTestingBuild and Deployment
ディスカッション

React ガイド · 2/6

Project Structure

この章は現在、英語でのみ提供しています。

This chapter walks through the folders and files generated by Vite's react-ts template, then covers configuration and folder layouts that hold up as a project grows.

The default layout

my-app/
├── public/
│   └── vite.svg
├── src/
│   ├── assets/
│   │   └── react.svg
│   ├── App.css
│   ├── App.tsx
│   ├── index.css
│   └── main.tsx
├── eslint.config.js
├── index.html
├── package.json
├── tsconfig.json
├── tsconfig.app.json
├── tsconfig.node.json
└── vite.config.ts
PathPurpose
index.htmlThe entry point. Vite starts here to find your scripts
src/main.tsxMounts React into the #root element of the HTML
src/App.tsxThe top-level component
src/assets/Images and fonts imported from code; built file names get a content hash
public/Files copied as-is (favicon, robots.txt and so on)
vite.config.tsVite configuration (plugins, path aliases, dev server)
tsconfig.*.jsonTypeScript settings split between app code (app) and config files (node)
eslint.config.jsESLint configuration, including the React hooks rules

index.html and main.tsx

Unlike many bundlers, Vite keeps index.html at the project root and treats it as the entry point. Starting from the src/main.tsx referenced by <script type="module">, it follows imports to load every module.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>my-app</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>

main.tsx calls createRoot from react-dom/client to create a React root on the #root element and renders App into it. App-wide providers such as a router, a data-fetching client or a theme usually wrap the tree here as well.

import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App.tsx";

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <App />
  </StrictMode>,
);
この章について質問がありますか?
前の章Getting Started with React次の章Core Concepts

package.json scripts

{
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  }
}

For speed, Vite only transpiles TypeScript and never type-checks it. That is why the build script runs tsc -b first and only calls vite build when there are no type errors. preview serves the build output locally so you can check it.

vite.config.ts and path aliases

To write @/components/Button instead of long relative paths like ../../components/Button, register the alias with both Vite and TypeScript.

import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
  },
  server: { port: 3000 },
});
{
  "compilerOptions": {
    "paths": { "@/*": ["./src/*"] }
  }
}

Add the paths entry to compilerOptions in tsconfig.app.json, which type-checks the app code. Using node:url in the config may require npm install -D @types/node.

Environment variables

Vite loads files such as .env, .env.local and .env.production from the project root. Only variables prefixed with VITE_ are exposed to client code, where you read them from import.meta.env.

# .env.local (keep this out of Git)
VITE_API_URL=http://localhost:8080
const apiUrl = import.meta.env.VITE_API_URL;
const isDev = import.meta.env.DEV;

These values are inlined into the bundle at build time, so anyone can read them. Never put secrets such as API keys into VITE_ variables; handle them on the server instead.

Organizing a growing project

React does not impose a folder structure. A small app is fine with a single src/components/; as it grows, grouping code by feature is a common approach.

  • src/components/: shared components used across screens, such as buttons and modals
  • src/features/<feature>/: the components, hooks and API calls that belong to one feature
  • src/hooks/: custom hooks shared between features, such as useDebounce.ts
  • src/lib/: UI-independent helpers and the API client
  • src/pages/ or src/routes/: page-level components when you use a router

By convention, component files use PascalCase names like UserCard.tsx and hooks start with use, as in useUser.ts. For styling you can import global CSS, use CSS Modules (Button.module.css) for locally scoped class names, or add a tool such as Tailwind CSS.

Summary

  • index.html is the entry point, and src/main.tsx mounts the React app into #root.
  • npm run build type-checks with tsc -b and then bundles with vite build.
  • Path aliases are registered in both vite.config.ts and tsconfig.app.json.
  • VITE_ environment variables are public, so never store secrets in them.
  • As the app grows, organize it by feature with consistent file naming.

コメント 0件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。