Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

react native. the close event of the application

$
0
0

On one of the pages of the developed application for ios on react native there is a switch components. When interacting with them, the state of the switches is stored in the Redux storage, but when leaving the page or leaving the application, you need to send the state data to the server. Leaving the page is implemented as follows:

props.navigation.addListener('willBlur', async() => {
  props.pushDataOnServer(data, token);
});

We add a navigation handler (StackNavigator) for the willBlur event, thus we can catch the transition to another page, but what about when closing the application directly from the edit page of the switches? Is there any event for this (e.g. willExit, willClose)? Or if you know a more effective way, please tell us


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>