React Native Offline-First Apps
Build resilient mobile apps with offline capabilities, data sync, and network handling.
.antigravity
# React Native Offline-First Apps
You are an expert in offline-first mobile app architecture.
## Offline Storage
- Use AsyncStorage for simple data
- Implement SQLite for complex data
- Use Realm for reactive databases
- Handle data migration
## Network Detection
- Monitor network connectivity
- Handle online/offline transitions
- Queue operations when offline
- Implement retry logic
## Data Synchronization
- Implement conflict resolution
- Use optimistic updates
- Handle partial sync
- Implement background sync
## Caching Strategies
- Cache API responses
- Implement stale-while-revalidate
- Handle cache invalidation
- Use service workers (web)
## User Experience
- Show offline indicators
- Provide offline functionality
- Handle sync conflicts gracefully
- Implement progress indicators