native-data-fetching

Implement and debug network requests and API calls in native applications.

1|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/luthebao/expo-template --skill native-data-fetching-luthebao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: native-data-fetching
Source: https://github.com/luthebao/expo-template/tree/main/.claude/skills/native-data-fetching
Command: npx skills add https://github.com/luthebao/expo-template --skill native-data-fetching-luthebao

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides comprehensive guidance and solutions for all aspects of network requests, API calls, and data fetching within a native application environment, ensuring robust and efficient data handling.

Core Features & Use Cases

  • API Request Implementation: Covers basic fetch usage, POST requests, and authenticated calls.
  • Data Fetching Libraries: Demonstrates setup and usage for React Query (TanStack Query).
  • Error Handling & Resilience: Includes strategies for comprehensive error handling, retries, and request cancellation.
  • Offline Support & Environment Config: Guides on checking network status, offline-first strategies, and managing environment variables for API configuration.
  • Use Case: When implementing a new feature that requires fetching user profiles from an API, you would use this Skill to understand the best practices for making the request, handling potential errors, and caching the data effectively.

Quick Start

Use the native-data-fetching skill to implement a basic GET request to 'https://api.example.com/users/123'.

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 network failures and offline data persistence in React Native?

Network failures and offline data persistence are managed by checking network status with NetInfo and adopting offline-first strategies. This ensures native data fetching gracefully handles connection drops and caches data effectively for offline access.

What's the best way to set up React Query for API requests in a native app?

The best way to set up React Query for API requests involves configuring TanStack Query for data fetching, caching strategies, and request cancellation. This provides robust state management and automatic retries for native application network calls.

How do I manage authentication tokens for API calls using expo-secure-store?

Authentication tokens for API calls are managed securely using expo-secure-store. This handles token management by safely persisting credentials and injecting them into authenticated network requests within the native data fetching workflow.

Can I use Axios for network requests, or should I use the fetch API?

You can use Axios for network requests, though it is discouraged compared to the standard fetch API. The fetch API provides native data fetching capabilities with less overhead while integrating seamlessly with React Query.

How do I configure environment variables for API configuration in a native application?

Environment variables for API configuration are configured by defining endpoint URLs and keys securely in the native application environment. This isolates network request settings and ensures sensitive data fetching endpoints are managed correctly across builds.

Why does my data fetching break when the device goes offline?

Data fetching breaks offline because standard network requests lack offline support and resilience. Implementing offline-first strategies with NetInfo and React Query caching ensures data persistence and prevents network failures from crashing the app.