How to retrieve datastore value before root component creates childstack #778
-
Hi arkivanov, I have a quick question and would like advice on how to go about it. Basically I have RootComponent and would like to know how to pass some datastore preference value whenever a location was selected previously, and base the initial configuration of the root components child stack when to show the initial screen based on the datastore preference. But it seems like the childstack of the root component create's the initial configuration before the datastore preference is retrieved. How would you solve this. Here's the code for the root component.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
The usual way is to show a loading screen (component) while you retrieve the value and then replace the stack with the actual component depending on the value. Probably, this can be also combined with a splash screen. |
Beta Was this translation helpful? Give feedback.
Yes, you will need to implement a loading UI, which kind of makes sense.