Set up app after fetching data #588
-
Hello I am having some issue understanding how to delay the init of the app. I want to do something similar to this small mock up, but it's not working:
} I want to start rendering everything only after I have my data properly initialized. Am I missing something? Any suggestion is well appreciated 🙂 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
When you say it's "not working," what exactly do you mean? Are there any errors? What are the symptoms indicating this code isn't working? |
Beta Was this translation helpful? Give feedback.
-
@IAmNelu posted on an example repo on discord, and I forked it and got it working... I am unsure if there is an issue with trying to conditionally render Application specificlly, but there are a lot of things that one may not expect to happen, if you mount Application and do not wait for the onInit callback. Maybe we can improve the documentation around how the renderer or other members of the app may not be accessible until after onInit has been called... i.e. renderer, or any getter derived from the renderer (width/height) etc. Additionally, there might be some more room to improve docs around how to use PixiViewport, or any other pixi component that may need to be subclassed for the best results. |
Beta Was this translation helpful? Give feedback.
@IAmNelu posted on an example repo on discord, and I forked it and got it working...
IAmNelu/testing-pixi@main...thejustinwalsh:testing-pixi:main
I am unsure if there is an issue with trying to conditionally render Application specificlly, but there are a lot of things that one may not expect to happen, if you mount Application and do not wait for the onInit callback.
Maybe we can improve the documentation around how the renderer or other members of the app may not be accessible until after onInit has been called... i.e. renderer, or any getter derived from the renderer (width/height) etc.
Additionally, there might be some more room to improve docs around how to use PixiViewport, or any o…