-
Notifications
You must be signed in to change notification settings - Fork 24.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When an Activity is destroyed, the AppState listeners are not cleared #45971
Comments
|
|
@noih Can you provide more info i.e is it happening in android old arch too and what about iOS ? |
OK, give me some time. |
I just built the latest version 0.75.1 and found that this issue no longer exists, whether on the new architecture or the original one, on iOS or Android. So I believe it has been resolved, and I'm closing this issue. |
Description
After an Activity is destroyed (such as leaving the app to select file), the
useEffect
cleanup function does not execute, sosubscription.remove
is not called. When the App returns to the foreground,AppState.addListener
is called again, causing multiple listener registrations that are never cleared.Since enabling
Don't keep activities
in Expo web causes the app to restart, I've attached a video and a code snippet.Steps to reproduce
Turning on
Don't keep activities
in the developer options.React Native Version
0.74.3
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/K5dooXY5Llvp4BezvP4Hg
Screenshots and Videos
clip.mov
The text was updated successfully, but these errors were encountered: