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:({setUi, getUi })=>{
// do something on screen mounted
}
};
onEnd:
This method is called whenever screen is unmounted
const screen = {
name: 'WelcomeScreen',
screen: {
v1: [text, ...],
},
onEnd:({setUi, getUi })=>{
// do something on screen unmounted
}
};