Here's a bug report every mobile team gets eventually:

"I was on the last step of checkout, switched to my bank app to grab the OTP, came back, and the app had restarted. Everything I typed was gone."

Nothing crashed. The OS needed memory, your app was in the background, and it got killed. When the user came back, React Native started fresh, with empty state and step one of five.

On iOS and Android this is normal. The longer the flow (checkout, onboarding, a loan application, a long form), the more likely it gets interrupted.

The usual workaround and its problems

Most apps reach for "persist the store": serialize the whole Redux or Zustand state to AsyncStorage and rehydrate it on launch. It works, but it brings a few problems:

  • It writes far more than you need. Every unrelated slice of state gets written on every change.
  • It can leave secrets on disk. The card number from step three sits in plain storage unless you remember to blacklist it.
  • It restores state blindly. An old snapshot from two app versions ago, or one half-written when the app died, gets loaded as if it were valid.
  • There's no "resume?" moment. The state is just there, whether or not it still makes sense.

What you actually want is narrower: for this one flow, save a checkpoint as the user moves forward, and on the next launch ask "pick up where you left off?", but only if the checkpoint is still valid.

A checkpoint per flow

That's what react-native-journey-recovery does. Each flow is a journey with its own small recovery record. It's independent of your state manager.

Install it with a storage backend:

npm install react-native-journey-recovery @react-native-async-storage/async-storage 

Wrap your app once:

import AsyncStorage from '@react-native-async-storage/async-storage'; import { AppState } from 'react-native'; import { RecoveryProvider, AsyncStorageAdapter } from 'react-native-journey-recovery'; const storage = new AsyncStorageAdapter(AsyncStorage); export default function App() { return ( <RecoveryProvider storage={storage} options={{ appState: AppState, // flush pending saves when the app backgrounds autoSave: true, debounceMs: 400, defaultExpiry: 24 * 60 * 60 * 1000, // 24 hours }} > <RootNavigator /> </RecoveryProvider> ); } 

Passing AppState matters here. The moment the app goes to the background, which is right before the OS might kill it, any pending debounced save is written.

Save as the user moves forward

import { useJourney } from 'react-native-journey-recovery'; type Checkout = { step: 'shipping' | 'payment' | 'review'; address?: Address }; function ShippingScreen({ navigation }) { const journey = useJourney<Checkout>('checkout'); const onContinue = async () => { journey.checkpoint({ step: 'payment', address }, { exclude: ['cardNumber'] }); await journey.flush(); // make sure it's written before navigating navigation.navigate('Payment'); }; // ... } 

exclude drops fields before anything touches disk, so you never have to remember to scrub them later.

Offer to resume on the next launch

import { useRecovery } from 'react-native-journey-recovery'; function CheckoutEntry() { const recovery = useRecovery<Checkout>('checkout'); if (recovery.status === 'checking') return <Loading />; if (recovery.available) { return ( <ResumePrompt savedAt={recovery.updatedAt} onResume={async () => resumeFrom(await recovery.restore())} onStartOver={recovery.discard} /> ); } return <ShippingScreen />; } 

available is only true when the checkpoint is safe to restore. If it's expired, corrupted, or written by a newer app version, the status is expired or invalid instead, and you show the normal first step.

Clear it when the flow is done

await api.placeOrder(cart); await journey.clear(); 

Without this, a finished checkout would be offered for resume next time.

Why this beats persisting everything

  • Only the flow's data is written, and only the fields you choose.
  • Every snapshot is checksummed, so a half-written record is reported as invalid and never restored.
  • Expiry is built in. A cart from last month doesn't come back to life.
  • The user decides whether to resume, which is better UX than silently dropping them on step four.

You can see all of this without installing anything: the live playground runs a real React Native app in the browser. Fill in a step, "kill" the app, corrupt the storage or let it expire, and watch what the library does.

How does your app handle this today? I'd like to hear whether you persist the whole store or do something more targeted.

react-native-journey-recovery: Checkpoint multi-step flows in React Native and Expo and restore them safely after the app is killed, crashes, or goes to the background.

Docs · Playground · GitHub · npm