What problem does it solve?
It solves the problem of building dependable network and data-loading behavior in React Native/Expo apps, including consistent error handling, token-based authentication, and predictable caching or offline behavior.
Core Features & Use Cases
- Deterministic networking with fetch: Implement API requests with correct JSON parsing, HTTP status checks, and typed error handling.
- Stateful data management: Use caching and retry patterns with React Query (TanStack Query) for queries and mutations.
- Expo Router route loading (web/SDK 55+): Apply loader-based data loading using Expo Router loaders where appropriate.
- Security-aware auth: Manage auth tokens using SecureStore and attach tokens to requests safely.
- Resilience: Handle offline status with NetInfo and integrate error recovery patterns.
- Environment-safe configuration: Configure API endpoints via EXPO_PUBLIC_ variables and avoid exposing secrets unintentionally.
Quick Start
Use native-data-fetching to implement an authenticated GET request with proper error handling and optional React Query caching for a screen that loads user profile data from an API endpoint.