native-data-fetching

Implement network requests and API data fetching for Expo and React apps.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Implements dependable networking patterns and debugging guidance to prevent flaky API calls, insecure token handling, and poor caching or offline behavior in Expo and React apps.

Core Features & Use Cases

  • Fetch API best practices: prefer built-in fetch, check response.ok, and parse JSON safely.
  • Caching & state management: React Query setup, queries, mutations, invalidation, and staleTime strategies.
  • Authentication & security: token storage with expo-secure-store, refresh flows, and secure headers.
  • Offline & resilience: NetInfo integration, retry with exponential backoff, request cancellation with AbortController, and Expo Router loaders for web SSR/static scenarios.

Quick Start

Ask the skill to review a failing Expo API request and provide corrected fetch code with error handling, caching recommendations, and secure token management.

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 secure token storage and refresh flows in Expo applications?

Secure token storage in Expo uses expo-secure-store to safely persist credentials and manage refresh flows. This ensures authentication headers remain protected during API data fetching and route transitions.

What's the best way to configure React Query caching and staleTime in a React app?

React Query caching in a React app uses query setup, mutations, and invalidation with staleTime strategies. This approach optimizes data fetching by controlling when cached data refreshes.

How do I handle API request cancellation with AbortController in React?

API request cancellation with AbortController in React integrates with React Query to abort ongoing fetch requests. This prevents memory leaks and race conditions during component unmounting.

How do I add offline detection and retry with exponential backoff to fetch requests?

Offline detection and retry with exponential backoff for fetch requests uses NetInfo integration to monitor connectivity. This resilience pattern retries failed API calls automatically when the network restores.

Does Expo Router support route-level data fetching for web SSR and static scenarios?

Expo Router supports route-level data fetching through loaders for web SSR and static scenarios. This allows pre-fetching API data before rendering to improve initial load performance and SEO.

Why does my Expo fetch call fail to parse JSON safely and check response.ok?

Expo fetch calls fail to parse JSON safely when response.ok is unchecked. Proper error handling validates the response status before parsing JSON to prevent silent failures and unhandled exceptions.