Skip to content
Discussion options

You must be logged in to vote

Hi @seanmrich, if I understand correctly, it seems that the child features should not each have their own navigation state. As you mentioned, that allows for invalid states.

Instead, the navigation state should be coalesced into the parent as a single piece of state. An enum would be great for this:

struct State {
  var destination: Destination?
}
enum Destination {
  case child1Sheet(Sheet.State)
  case child2Sheet(Sheet.State)
}

Technically, TCA has all the tools to accomplish this, they just aren't very ergonomic right now. The brand new navigation APIs we are working on will make this much nicer.

I would say give that domain modeling a shot and let us know if you have any questions. T…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@seanmrich
Comment options

@corysullivan
Comment options

@mbrandonw
Comment options

@corysullivan
Comment options

Answer selected by seanmrich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants