Screen Life Cycle Events
Understanding screen onStart and onEnd
Whenever a screen is mounted and unmounted, there are two methods gets called for each screen.
onStart:
This method is called whenever screen is mounted.
const screen = {
name: 'WelcomeScreen',
screen: {
v1: [text, ...],
},
onStart:({ route, setUi, getUi })=>{
// do something on screen mounted
}
};
onEnd:
This method is called whenever screen is unmounted
const screen = {
name: 'WelcomeScreen',
screen: {
v1: [text, ...],
},
onEnd:({ route, setUi, getUi })=>{
// do something on screen unmounted
}
};