native-data-fetching

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

2|1|Updated May 23, 2025
One-click install
npx skills add https://github.com/karthiknish/aroosi --skill native-data-fetching-karthiknish
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: native-data-fetching
Source: https://github.com/karthiknish/aroosi/tree/main/apps/mobile/.agents/skills/native-data-fetching
Command: npx skills add https://github.com/karthiknish/aroosi --skill native-data-fetching-karthiknish

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear, production-oriented guidance and patterns for implementing, debugging, and hardening network requests and API data fetching in Expo and React Native apps, reducing flaky requests, insecure token handling, and poor offline behavior.

Core Features & Use Cases

  • Fetch patterns and error handling: guidance for using fetch with structured HTTP error parsing and retry/backoff strategies.
  • State & caching: recommendations for integrating React Query or SWR for caching, invalidation, and deduplication.
  • Authentication and token management: secure storage practices and refresh flows using expo secure storage.
  • Offline and cancellation: network status detection, query pause/resume, and request cancellation strategies.
  • Environment configuration: use of EXPO_PUBLIC_ variables for environment-specific API endpoints and build-time safety notes.

Quick Start

Use this skill to implement or debug network requests, caching, and secure token handling in your Expo React Native app using fetch or React Query.

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 data fetching and offline support in React Native?

API data fetching and offline support in React Native can be handled using fetch with structured error parsing, React Query for caching, and network status detection to pause and resume queries when connectivity changes.

What's the best way to manage secure authentication tokens in Expo apps?

Secure authentication token management in Expo apps involves using expo secure storage for sensitive credentials and implementing refresh flows to maintain secure sessions without exposing tokens to insecure storage.

How do I cancel network requests in React Native when a component unmounts?

Cancel network requests in React Native by using AbortController, which allows you to terminate ongoing fetch operations cleanly when a component unmounts or user actions require cancellation.

Can I use React Query with React Native to synchronize data fetching with network status?

React Query integrates with React Native to synchronize data fetching with network status by pausing queries when offline, resuming them when online, and handling caching, invalidation, and deduplication automatically.

How do I configure environment-specific API endpoints in an Expo application?

Configure environment-specific API endpoints in Expo by using EXPO_PUBLIC_ variables, which allow you to define build-time environment configurations safely without hardcoding endpoints into your application code.

Why do my fetch requests fail and how do I implement retry logic in React Native?

Fetch requests fail due to network instability or server errors, and you can implement retry logic in React Native using structured backoff strategies to automatically re-attempt failed API requests.