native-data-fetching

Standardize fetch patterns, error handling, caching, and request lifecycle in Expo/React Native apps.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/soham2008xyz/trade-tycoon --skill native-data-fetching-soham2008xyz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: native-data-fetching
Source: https://github.com/soham2008xyz/trade-tycoon/tree/main/.agents/skills/native-data-fetching
Command: npx skills add https://github.com/soham2008xyz/trade-tycoon --skill native-data-fetching-soham2008xyz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents broken or insecure network requests in mobile apps by providing consistent patterns for fetching data, handling errors, caching, authentication, and offline behavior.

Core Features & Use Cases

  • Standardized fetch and API error handling: Ensure every request checks response.ok, parses JSON safely, and throws actionable errors for both HTTP and network failures.
  • Caching and state management: Use React Query for deduplication, retries, cache invalidation, stale times, and mutation flows.
  • Expo-native requirements: Support Expo Router loader data patterns (web), token storage via SecureStore, request cancellation, and offline detection using NetInfo.

Quick Start

Use the native-data-fetching skill whenever you implement or debug an API call or data loader in your Expo app by following its fetch, React Query, error handling, auth, and offline guidance.

Frequently Asked Questions about native-data-fetching

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

FAQPage Schema
How do I handle API fetch errors in React Native?

Handle API fetch errors in React Native by standardizing request patterns to check `response.ok`, safely parse JSON, and throw actionable errors for both HTTP and network failures. This approach ensures reliable debugging across mobile app navigation flows.

How do I manage data fetching and caching in Expo apps?

Manage data fetching and caching in Expo apps by using React Query for request deduplication, retries, cache invalidation, stale times, and mutation flows. This integrates with Expo Router loaders to provide consistent state management across UI navigation.

What is the best way to store authentication tokens in Expo?

The best way to store authentication tokens in Expo is using SecureStore. This method securely manages authentication tokens for network requests, ensuring sensitive data remains protected while maintaining consistent API request lifecycles.

How do I implement offline-aware data fetching in React Native?

Implement offline-aware data fetching in React Native by integrating NetInfo to detect network status. This allows your application to adapt network requests, manage caching behavior, and handle request lifecycle events when connectivity is lost or restored.

Does this Expo data fetching pattern support request cancellation?

Yes, this Expo data fetching pattern supports request cancellation using AbortController. It manages request lifecycles by canceling unnecessary or duplicate network requests during UI navigation transitions, preventing memory leaks and stale data updates.

Why use fetch instead of axios for networking in Expo?

Use fetch instead of axios for networking in Expo to standardize API requests natively without extra dependencies. This approach enforces consistent response validation, typed error construction, and aligns with Expo_PUBLIC configuration rules for client-safe API endpoints.