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.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (4)
Pretty sure AppState - background will fire when you close the app. reactnative.dev/docs/appstate
Thats really helpful..Didnt know about this..Thanks Abe..
No problem, let me know if it works out for you!
it doesn't