I have looked into the navigationstack of the conf...
# decompose
I have looked into the navigationstack of the confetti app and noticed that instead of making SessionDetails and SpeakerSetails childs of respectively SessionsComponent and Speakerscomponent they are children of ConferenceComponent. I wonder: Is this done because of the possibility to navigate from SessionDetails to SpeakerDetail and visa versa? In other words, if this was not the case wouldn’t it be better to make them children of SessionsComponent and SpeakersComponent?
Good question!
displays a list of sessions,
component displays details of a selected session. Their common parent switches between them. The same is applicable to speakers. Looking at
, the structure is as follows.
Copy code
ConferenceComponent (once a conference is selected, fullscreen)
  HomeComponent (bottom tab bar with child components, fullscreen)
    SessionsComponent (not fullscreen, above the bottom bar)
    SpeakersComponent (not fullscreen, above the bottom bar)
  SessionDetails (fullscreen)
  SpeakerDetails (fullscreen)
Ah so it’s basically because of the bottom tab bar (fullscreen or not). Thnx I understand.
Not really. If I understand it correctly, you asked why SessionDetails is not a child of SessionsComponent. Even without bottom bar, it's good to have a parent that organises child components into a stack. E.g. a list component shouldn't have details as a child, a parent component should manage them instead.
But due to the bottom bar, there is one more intermediate child - HomeComponent.
I think I understand what the idea is. But one last question. Could there be a scenario were for example 1 tab has its own navigationstack with children or is recommended to let ConferenceComponent handle it all?
Of course, if you need a stack in a tab, then there should be a parent component as well. This is how the sample in Decompose repo works. CountersCompoment is in the first tab, it has a stack of CounterComponent. It all depends on your design requirements.
Yes I noticed. Thanks for all your help. really appreciate it.