native-data-fetching

Implement and debug API calls, data fetching, and caching in Expo/React Native apps.

6|Updated Jan 24, 2025
One-click install
npx skills add https://github.com/Liinkiing/larastack --skill native-data-fetching-liinkiing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: native-data-fetching
Source: https://github.com/Liinkiing/larastack/tree/main/.agents/skills/native-data-fetching
Command: npx skills add https://github.com/Liinkiing/larastack --skill native-data-fetching-liinkiing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured approach to implementing and debugging API calls, data fetching, caching, and offline strategies in Expo/React Native projects.

Core Features & Use Cases

  • Fetch data using fetch, Axios, or React Query with consistent error handling and retry strategies.
  • Manage authentication tokens securely with expo-secure-store and support token refresh flows.
  • Enable offline support and reliable caching with React Query and online/offline status detection.
  • Configure environment-based API URLs using EXPO_PUBLIC_* variables for dev and prod.

Quick Start

Install or integrate this skill into your Expo/React Native project, create a reusable data-fetching wrapper around fetch/axios, wire it to React Query for caching, and configure authentication and environment variables for your API.

Frequently Asked Questions about native-data-fetching

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

FAQPage Schema
How do I implement API data fetching with offline support in Expo and React Native?

Configure environment-based API URLs in Expo using EXPO_PUBLIC_* variables to manage dev and prod endpoints. This setup allows you to dynamically switch API configurations without modifying core request logic.

How do I securely store and refresh authentication tokens in a React Native app?

Securely store authentication tokens in React Native using expo-secure-store, which provides encrypted keystore access. You can build token refresh flows around this storage to automatically manage expired credentials during data fetching.

How do I cancel network requests and handle API errors with retries in React Native?

Cancel network requests in React Native using AbortController to abort ongoing fetch calls. Combine this with structured error handling and retry strategies in React Query to manage failed API requests automatically.

Does React Query work with fetch and Axios for data caching in Expo projects?

Yes, React Query works with both fetch and Axios in Expo projects to provide consistent data caching. It integrates with custom wrappers to manage request states, retries, and offline persistence seamlessly.