What problem does it solve?
This Skill removes the guesswork and fragile patterns around implementing and debugging network requests, API calls, and data fetching in Expo and React Native projects by prescribing secure, reliable, and testable approaches.
Core Features & Use Cases
- Fetch best practices: guidance for using the fetch API safely with status checks, JSON parsing, and AbortController cancellation.
- State & caching: recommendations and examples for React Query and SWR integration, query invalidation, staleTime, and deduplication.
- Error handling & retries: typed API errors, retry with exponential backoff, and distinguishing HTTP vs network failures.
- Authentication: secure token storage with expo-secure-store, authenticated fetch wrappers, and coordinated token refresh logic.
- Offline & performance: NetInfo integration for online detection, React Query onlineManager sync, and caching/persistence strategies.
- Expo Router loaders: route-level loader patterns, server vs static execution notes, and useLoaderData typing for web SDK 55+.
- Environment configuration: guidance on EXPO_PUBLIC_ variables, environment-specific endpoints, and secret handling for server-side code.
Quick Start
Use the native-data-fetching skill to implement a secure fetch wrapper with error handling, token refresh, React Query integration, and offline detection.