native-data-fetching

Implement network requests, caching, and offline support for Expo and React Native apps.

Updated May 28, 2026
One-click install
npx skills add https://github.com/qbstabletampa-creator/firmware-foundation-studios --skill native-data-fetching-qbstabletampa-creator
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: native-data-fetching
Source: https://github.com/qbstabletampa-creator/firmware-foundation-studios/tree/main/archive/apps/manna-catch/.agents/skills/native-data-fetching
Command: npx skills add https://github.com/qbstabletampa-creator/firmware-foundation-studios --skill native-data-fetching-qbstabletampa-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @tanstack/react-query, expo-secure-store, @react-native-community/netinfo, expo-router, expo-server, and includes references (resource) components.

What problem does it solve? Building reliable networking in Expo and React Native apps requires handling fetch errors, authentication tokens, caching, offline states, and environment configuration, which is error-prone when done ad hoc. ## Core Features & Use Cases - Fetch and Error Handling: Patterns for GET/POST requests with typed errors, retry logic with exponential backoff, and AbortController cancellation. - Data Fetching Libraries: Setup and usage guidance for React Query (TanStack Query) and SWR, including mutations, cache invalidation, and offline synchronization with NetInfo. - Auth and Configuration: Token storage with expo-secure-store, token refresh flows, and API URL management via EXPO_PUBLIC_ environment variables. - Use Case: When adding an authenticated API call to an Expo app, apply the authFetch wrapper with SecureStore token retrieval, wrap it in a React Query mutation, and configure per-environment base URLs. ## Quick Start Use the native-data-fetching skill to implement a cached, authenticated API request with error handling in my Expo app.

Frequently Asked Questions about native-data-fetching

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

FAQPage Schema
How do I make API calls in React Native with fetch?▼

Use the fetch API with explicit response status checks: call fetch, verify response.ok, and throw typed errors for non-2xx statuses. Wrap requests in a helper that distinguishes HTTP errors from network failures for consistent handling.

Should I use React Query or SWR for data fetching?▼

React Query (TanStack Query) suits complex apps needing mutations, cache invalidation, and offline persistence, while SWR fits simpler fetching needs. React Query also integrates with NetInfo via onlineManager to pause queries when offline.

How do I store authentication tokens securely in Expo?▼

Store tokens with expo-secure-store, not AsyncStorage, since SecureStore encrypts sensitive values. Combine it with an authFetch wrapper that attaches the Bearer token and a refresh flow that deduplicates concurrent refresh requests.

Does Expo Router support server-side data loading?▼

Expo Router supports route-level data loaders on web with SDK 55+ by exporting an async loader function and reading it with useLoaderData. Loaders are web-only; native platforms should use React Query or fetch instead.

How do I configure different API URLs for development and production in Expo?▼

Define EXPO_PUBLIC_ prefixed variables in .env.development and .env.production files, then read them via process.env. These values are inlined at build time, so restart the dev server after changes and never put secrets in prefixed variables.

Why do my React Query requests not pause when the device goes offline?▼

React Query only pauses queries if onlineManager is synced with network status. Register a NetInfo event listener with onlineManager.setEventListener so queries pause offline and resume when connectivity returns.