React Native interview question · Most asked

How would you make a React Native app work offline?

Create a free account to save this page, take notes and track your progress. Sign in

Summary

Read from a local store first, write changes locally and optimistically, queue them in a persisted outbox with client-generated IDs, and sync when connectivity returns; the server deduplicates by those IDs.

Longer Answer

Listen for connectivity (NetInfo) and app start to flush the outbox. Remove an operation only after the server confirms it. Define a conflict policy (last write wins by timestamp, field-level merge, or prompting the user). Show sync status in the UI. Cache server reads (e.g. TanStack Query with persistence) so screens render without the network.

Key Points

  • Local-first reads and writes.
  • Persisted outbox + idempotent client IDs.
  • Remove only after confirmation.
  • Explicit conflict policy and visible sync state.

Deep dive: Mobile Apps with React Native and Expo: Working Offline

Explanation

What interviewers look for

Idempotency, durability across restarts, and conflict handling, not just 'cache the API'.

Follow-up questions

  • How do you handle two devices editing the same record?
  • What if the server rejects a queued change?

More most-asked React Native questions

← All React Native questions

Was this page helpful?