I want to run a code before a React-native app close. So when we close the app, before it closes, I want to run a JS code. Does anyone know a way to achieve that? I used useState clean up but doesnt seem to be firing when I close the app.
Top comments(4)
Subscribe

Abe Dolinger•
Frontend / React Native dev
- LocationSeattle
- EducationFlatiron School
- PronounsHe/him
- WorkMobile Engineer @ Treecard
- Joined
Pretty sure AppState - background will fire when you close the app.reactnative.dev/docs/appstate

Abe Dolinger•
Frontend / React Native dev
- LocationSeattle
- EducationFlatiron School
- PronounsHe/him
- WorkMobile Engineer @ Treecard
- Joined
No problem, let me know if it works out for you!
For further actions, you may consider blocking this person and/orreporting abuse