-
Hello, I've got a question about the implementation of composable navigation. I implemented a complete flow as mentioned in this composable navigation post. I grouped all the possible sheets my app can present into a single view, which we'll call the 'master sheet'. This sheet has an enum of all possible child sheets as a state property. All these child sheets utilize TCA. My issue is, even after implementing the technique from the article, when a child sheet updates its state, the view doesn't register this change. But when the same child sheet is presented directly from the parent, everything operates smoothly. Could this be a limitation, bug, or am I possibly making a mistake? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi @mlouli, first I would suggest following the tutorials in the repo rather than that blog post, which was posted many months ago at the beginning of the beta period. And second, it's hard to say what the problem is without seeing some code. Can you share a minimal project that demonstrates the problem you are seeing? |
Beta Was this translation helpful? Give feedback.
I didn't notice in your first code snippet, but the problem is that you are creating a whole new store from scratch to pass along to the child view:
That store is fully disconnected from the parent store, and so it is not surprising that it isn't picking up state changes. Typically one derives a store from the parent to hand down to the child.
It seems that either that state should not be an enum, or you should follow the steps outlined in the tutorial (in particular this section) to see how to properly drive navigation from an …