I have looked into the navigationstack of the conf...
# decompose
f
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?
a
Good question!
SessionsComponent
displays a list of sessions,
SessionDetails
component displays details of a selected session. Their common parent switches between them. The same is applicable to speakers. Looking at
ConferenceComponent
, 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)
  ...
f
Ah so it’s basically because of the bottom tab bar (fullscreen or not). Thnx I understand.
a
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.
f
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?
a
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.
f
Yes I noticed. Thanks for all your help. really appreciate it.