Replies: 1 comment 1 reply
-
@p4checo did you end up finding a solution for this? I'm trying to achieve the same result that you mentioned but I'm having no success. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 👋🏼
First of all, thanks for the awesome work being done for the community and advancement of the iOS "race" 🙇🏼
Considering that
NavigationStack
(andNavigationStackStore
) don't seem to allow nesting, are there any ideas to enable nesting child features with their own navigation stack setup (Path.State
,Path.Action
) in a parent feature, while preserving a single navigation root in the parent?As apps naturally grow in complexity, it's easy to see some root level features/views becoming huge beasts as the number of possible stack navigations increase if we need to have them "flattened" on the root feature.
Additionally, this has a big impact on feature composition, most likely leading to duplicated navigation logic as we can't reuse a child feature's navigation flow in two separate parent features (each with its own navigation stack).
Consider the following setup:
Using the current stack navigation tools, it seems we would have to replicate the child feature C's navigation handling in both features A and X, because they own the
StackState
which is what drives the navigation stack. So, in each of the parent features A and X we would need to add handling for feature C's sub-features, i.e. add them to thePath.State
andPath.Action
, as well as duplicating the "internal" logic of Feature C to orchestrate navigating between its sub-features L, M, N.In theory it seems to be a case of merging/flattening
StackState
s andStackAction
s, but the reducer composition logic is making my brain hurt a bit 😅At the SwiftUI level I think that the existing tools should already support this, as the views returned by
CaseLet
's inside theNavigationStackStore
sdestination
closure could "drill down" to otherSwitchStore
+CaseLet
providing the sub-sub-feature's views (and so on). The caveat is that no sub-feature's can have aNavigationStackStore
though.Thanks! 🙏🏼
Beta Was this translation helpful? Give feedback.
All reactions