Skip to content
プロジェクト

KevinVandy/react-data-fetching

GitHubで見る

概要

同じアプリを異なるReactフレームワークで何度も構築し、同じ条件で比較します。

Web・アプリ開発

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

React Data Fetching

This repository demonstrates the four main data-fetching strategies in modern React applications: Client-Side Rendering (CSR), Static Site Generation (SSG), Server-Side Rendering (SSR), and Streaming with React Server Components. Each approach is implemented across multiple frameworks to show real-world patterns and trade-offs.

Table of Contents

Client-Side Rendering (CSR/SPAs)

Static Site Generation (SSG)

Server-Side Rendering (SSR)

HTML Streaming (RSC / Astro Server Islands)

Understanding Data-Fetching Strategies

Each directory contains a README explaining the core concepts, pros and cons, and use cases:

  • apps/1-csr/ - Client-Side Rendering: JavaScript fetches data in the browser
  • apps/2-ssg/ - Static Site Generation: Pages built at build time with data pre-fetched
  • apps/3-ssr/ - Server-Side Rendering: HTML generated on server per request
  • apps/4-streaming/ - Streaming: Progressive page delivery with React Server Components

Frameworks Covered

This repository explores data fetching across multiple meta-frameworks and libraries:

  • React Router - Client-side and server-side routing
  • Next.js - Full-stack React framework with SSG, SSR, and RSC
  • Astro - Multi-framework static site generator with server rendering
  • TanStack Router - Type-safe routing with built-in data loading
  • TanStack Start - Full-stack React framework built on TanStack Router
  • SvelteKit - bonus Full-stack Svelte framework for comparison

Getting Started

  1. Install dependencies: pnpm install
  2. Start the backend: pnpm serve (runs json-server on port 3300)
  3. Run any example app using the commands listed above
  4. Each app fetches data from the same API to demonstrate different approaches

The examples progress from basic patterns to more advanced implementations, showing how each strategy evolves with different tools and frameworks. TanStack Query (React Query) is heavily featured throughout, demonstrating how this powerful data-fetching library integrates with various meta-frameworks - from pure client-side apps to server-rendered applications with hydration, and even alongside React Server Components for optimal user experiences.

関連プロジェクトを探す

読み込み中…