Skip to main content
Version: 1.0.52

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:({uiElements, setUi})=>{
// do something on screen mounted

//setUi(uiElements);
}
};

onEnd:

This method is called whenever screen is unmounted

const screen = {
name: 'WelcomeScreen',
screen: {
v1: [text, ...],
},
onEnd:({uiElements, setUi})=>{
// do something on screen unmounted
// setUi(uiElements);
}
};