stinsen
stinsen copied to clipboard
Make a `RouterStore` per `NavigationCoordinatable`
I have a use case that I have a 3 tabs, they each holds a NavigationCoordinatable
. Each tab can navigates to some screens, and there are shared screens between tabs.
I made 1 NavigationCoordinatable
type for both 3 tabs as the screen routes are pretty much the same.
Now within each tab, if I reference the coordiantor.route using @EnvironmentObject
, everything's fine. However, when use RouterStore
, since it's shared one, the router object I get is incorrect (becasue I have 3 same ones).
I suggest RouterStore
should propage the same as a @EnvironmentObject
Yes, I agree. RouterStore
should work the same way as EnvironmentObject
. RouterStore
is a bit tricky, but I'll take a look at this use case and see if it is possible to fix. But as you say, EnvironmentObject
is a workaround, or passing the NavigationCoordinatable
also works well.