react-data-fetching

Coordinate React data fetching with caching, parallel requests, and optimistic updates.

235|25|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/PatternsDev/skills --skill react-data-fetching-patternsdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-data-fetching
Source: https://github.com/PatternsDev/skills/tree/main/react/react-data-fetching
Command: npx skills add https://github.com/PatternsDev/skills --skill react-data-fetching-patternsdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill consolidates modern React data-fetching patterns to reduce repeated fetch logic, improve caching, and minimize UI waterfalls, enabling more reliable data-driven interfaces.

Core Features & Use Cases

  • Caching and deduping with TanStack Query and SWR to reduce redundant requests and speed up UI.
  • Parallel data loading to prevent sequential waterfalls and improve perceived performance.
  • Suspense-based loading coordination to simplify UI loading states across components.

Quick Start

Apply these patterns to fetch and cache server data in your React components to reduce waterfalls and improve user experience.

Frequently Asked Questions about react-data-fetching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent React data fetching waterfalls when loading multiple components?

Prevent React data fetching waterfalls by structuring parallel data requests within your components. This pattern coordinates concurrent queries to improve perceived performance and minimize sequential loading delays across the UI.

What is the best way to implement optimistic updates with TanStack Query in React?

Implement optimistic updates by applying structured patterns with TanStack Query to coordinate local cache mutations immediately. This simplifies state management by updating the UI instantly before server confirmation arrives.

How does React Suspense coordinate loading states for data fetching?

React Suspense coordinates loading states by suspending component rendering until fetched data resolves. This pattern simplifies UI loading logic across nested components by providing a unified fallback state.

Can I use prefetching with SWR to reduce redundant network requests in React?

Yes, you can use prefetching with SWR to populate the cache before component mounts. This reduces redundant requests and speeds up the UI by ensuring data is already available during navigation.

When should I use TanStack Query versus SWR for caching in React applications?

Use TanStack Query or SWR for caching based on your coordination needs; both dedupe requests and speed up UI. TanStack Query offers advanced mutation features, while SWR provides lightweight stale-while-revalidate caching.

Why does my React component still show a loading waterfall after implementing basic fetch logic?

Sequential fetch logic causes loading waterfalls because requests run one after another. You need structured patterns for parallel data loading to prevent this and improve perceived load performance.