AppLoading setsate life cycle

I have no idea about AppLoading demo.

why after restart the app, the state is still ready?

how should we reset this state?

I do not understand your problem, can u explain mote about your project, or share a code?

About de demo:
In the demo we have a function _cacheResourcesAsync, this function is responsable to load all assets,for example, images, fonts, etc.
This functions is passed to AppLoading component.

onFinish={() => this.setState({ isReady: true })}

When this function completes the loads AppLoading component trigger onFinish event that trigger () => this.setState({ isReady: true }) arrow function.

this arrow function changes de state to isReady: true. this.setState() runs render() again

render() {
  if (!this.state.isReady) {
 // ... AppLoading code
// ... Your App Code

The next execution of the code will return “Your App Code” instead “AppLoading code”.
While “AppLoading code” are returned the app stays on Splash Screen, then when render return “Your App Code”, user wee see Your code rendered on the screen.

@singleseeker i hope i’ve helped you.


@victorwads Good job. Save my life.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.