App resets on Android devices if it enters background

Please provide the following:

  1. SDK Version: expo-cli@5.0.3 / expo@43.0.5
  2. Platforms(Android/iOS/web/all): Android

Hi!

I’m facing issues when my Expo app enters the background on Android; it resets the app as soon as it enters foreground again. I have a screen recording here of what the issue is: Screen Recording Expo Go - YouTube

This issue is detrimental to the functionality of my app, since it would reset all form inputs and prevents the user from adding an image (app enters background when opening image picker).

Does anyone know what might be causing this issue?
Here are my dependencies if at all interesting:


  "dependencies": {
    "expo": "~43.0.2",
    "expo-font": "~10.0.3",
    "expo-image-picker": "~11.0.3",
    "expo-status-bar": "~1.1.0",
    "firebase": "^9.6.3",
    "lodash": "^4.17.21",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-safe-area-context": "3.3.2",
    "react-native-svg": "12.1.1",
    "react-native-uuid": "^2.0.1",
    "react-native-web": "0.17.1",
    "react-router-dom": "^6.1.1",
    "react-router-native": "^6.1.1",
    "react-spring": "^9.3.2",
    "validator": "^13.7.0",
    "expo-splash-screen": "~0.13.5",
    "expo-updates": "~0.10.13",
    "react-native-reanimated": "~2.2.0",
    "react-native-screens": "~3.8.0"
  },

I have some suspicions that it’s actually react-router-native that is causing these issues. When I use the react-navigation library in another app it doesn’t reset when re-entering foreground. Does anyone have any experience with react-router-native and can confirm/deny?

I found my issue.
I’m a dumdum who had implemented a key on the main app wrapper that changed on entering foreground without me knowing. Just another lesson in always assuming you’re dumber than you think you are.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.