react-data-fetching

Refactor React fetch logic with TanStack Query and parallelize independent requests.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI --skill react-data-fetching-quanngynx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-data-fetching
Source: https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI/tree/main/servexa-warranty-ai/.agents/skills/react-data-fetching
Command: npx skills add https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI --skill react-data-fetching-quanngynx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React apps often suffer from slow and inconsistent data loading due to request waterfalls and redundant fetches, which increases latency and complicates loading/error handling.

Core Features & Use Cases

  • Parallelize independent requests to remove client-side waterfalls (e.g., user + posts + notifications loading together).
  • Use TanStack Query (or SWR) for caching and deduplication to prevent repeated network calls and simplify retry/error states.
  • Adopt Suspense and prefetching to coordinate declarative loading states and eliminate navigation loading delays.

Quick Start

Use the react-data-fetching skill to refactor your React fetch logic by replacing fetch-in-effect with TanStack Query, and then reorganize queries to parallelize independent requests with Suspense boundaries.

Frequently Asked Questions about react-data-fetching

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

FAQPage Schema
How do I fix slow React data loading caused by request waterfalls?

Fix slow React data loading by parallelizing independent requests with Promise.all and deferred awaiting to remove client-side waterfalls, reducing latency and redundant fetches in component trees.

How do I prevent redundant network calls in React components?

Prevent redundant network calls in React by implementing client-side caching and deduplication using TanStack Query or SWR to avoid repeated fetches and simplify retry and error states.

How do I coordinate declarative loading states in React with Suspense?

Coordinate declarative loading states in React by adopting Suspense boundaries to manage loading coordination, allowing declarative UI fallbacks while queries resolve in parallel.

What is the best way to prefetch data before navigation in React?

Prefetch data before navigation in React by triggering queries before route transitions, eliminating navigation loading delays and ensuring data is cached and ready for immediate rendering.

How do I implement optimistic updates with TanStack Query?

Implement optimistic updates with TanStack Query by applying immediate UI state changes before server confirmation, improving perceived performance while maintaining reliable data synchronization.

Can I use SWR instead of TanStack Query for React data fetching?

Use SWR instead of TanStack Query for React data fetching when you need lightweight caching and deduplication; both prevent repeated network calls and simplify retry and error states for client-side scenarios.