I have the following component hierarchy: A/B1/C1/...
# decompose
e
I have the following component hierarchy: A/B1/C1/D1 (B1 is child of A, C1 of B1 etc) What are my options if I need to navigate from D1 to some another child B2 and back?
I can pass callback through all hierarchy to call B2 from D1, but it is a bit weird. The root back looks pretty strait-forward: I will pop B2 and it probably should bring B1/C1/D1 back. Are any other ways to do that?
a
You can pass a callback down the hierarchy, then call it from D1, and navigate in A.
e
Yes, I meant the same 🙂. But am not sure if it is the best option
a
Yeah, I've sent the message before I've seen your second one. 🙂 From my point of view, this is the best option. You can also share your root Config classes and then pass the root StackNavigator down the hierarchy. But it will result in coupling.
e
Thanks again!
👍 1