expo-data-fetching

Implements API requests, caching, and offline data fetching in Expo React Native apps.

16|1|Updated May 5, 2026
One-click install
npx skills add https://github.com/AIBiz-Automatyzacje/workspace-template-mobile --skill expo-data-fetching-aibiz-automatyzacje
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expo-data-fetching
Source: https://github.com/AIBiz-Automatyzacje/workspace-template-mobile/tree/main/.claude/skills/expo-data-fetching
Command: npx skills add https://github.com/AIBiz-Automatyzacje/workspace-template-mobile --skill expo-data-fetching-aibiz-automatyzacje

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? Networking in React Native apps involves repetitive boilerplate: error handling, token management, retries, caching, and offline support. This Skill provides proven patterns for every network request in an Expo app, so you avoid common mistakes like storing tokens insecurely or ignoring HTTP error statuses. ## Core Features & Use Cases - Fetch & Error Handling: Typed ApiError classes, response status checks, and retry logic with exponential backoff using the Fetch API. - React Query Integration: QueryClient setup, queries, mutations with cache invalidation, and offline-first syncing via NetInfo and onlineManager. - Auth & Security: Token storage in expo-secure-store, authenticated fetch wrappers, and token refresh flows that prevent race conditions. - Expo Router Loaders: Route-level data loading with useLoaderData for web (SDK 55+), including server vs static rendering guidance. - Use Case: You need to build a user profile screen that fetches data from your API, caches it for 5 minutes, works offline, and attaches a securely stored auth token to every request. ## Quick Start Use the expo-data-fetching skill to set up React Query with an authenticated fetch wrapper and offline support in my Expo app.

Frequently Asked Questions about expo-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 Expo?

Use the built-in Fetch API with explicit response status checks: verify response.ok before parsing JSON and throw typed errors for failures. Prefer expo/fetch over axios, and wrap requests in an error-handling helper for consistent behavior.

Should I use React Query or SWR for data fetching?

React Query (TanStack Query) suits complex apps needing mutations, cache invalidation, and offline persistence. SWR or custom hooks work for simpler fetching needs. React Query also cancels requests automatically on unmount.

How do I store authentication tokens securely in Expo?

Store tokens in expo-secure-store, never in AsyncStorage, which is not encrypted. Implement a refresh flow with a shared refresh promise to prevent concurrent refresh requests when tokens expire.

How do I support offline mode in a React Native app?

Use @react-native-community/netinfo to detect network status and sync it with React Query's onlineManager. Queries then pause when offline and resume automatically when connectivity returns.

Can I use Expo Router loaders on native platforms?

No, Expo Router data loaders with useLoaderData are web-only and require SDK 55+ with server or static web output. For native iOS and Android, use client-side fetching with React Query or fetch instead.

Where should I put API keys in an Expo app?

Client-safe keys go in .env with the EXPO_PUBLIC_ prefix, but these are embedded in the app bundle. Secret keys must use non-prefixed environment variables and only be accessed server-side, such as in API routes or loaders.