Rn Data Fetching

Use when fetching data from APIs in React Native: choosing between fetch+useEffect (didactic only) and TanStack Query (production default), wiring the QueryClient provider, building queries / mutations / optimistic updates / paginated and infinite lists / cache invalidation / refetch on focus, handling loading and error states, AsyncStorage persistence, offline-first behavior. Triggers on: "fetch posts from API", "infinite scroll", "optimistic mutation", "cache invalidation", "loading state". Not for: styling lists (rn-styling), backend setup (rn-backend, Wave 3 — provider-agnostic), GraphQL clients (out of scope).

lukedj78 7a8c5f8 9 files · 34.2 KB Updated

File contents

lukedj78/dev-flow/tree/main/rn-data-fetching commit 7a8c5f8142

Frequently asked questions

npx skillmds@latest add lukedj78/rn-data-fetching