State-driven navigation tools within the context of a hyper-modularized codebase #2149
acosmicflamingo
started this conversation in
Beta
Replies: 1 comment 1 reply
-
This is something that has been discussed a few times in episodes, and it is covered in some of the documentation. There is a balance between coupling and decoupling features. Decoupling sounds like a good idea, and nav stacks help with it, but it also comes with some downsides. You just need to figure out which aspects of tree and stack-based navigation are important to you and make the choice yourself. But, at the end of the day you can also find work arounds for navigating from deep parts of the app. For example, the settings feature could post a notification that the root listens for in order to update the navigation stack. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'll preface this by saying that the new navigation tools are light-years beyond what I'd ever expect from TCA and am absolutely floored by how powerful and amazing it is!
The only question I have that I don't think has been addressed (and probably because it's the smallest corner-case in the world) is how we can achieve the same behavior of deep-linking outside of the app's root view if the new tools seem to assume that the stack state belongs in only one place, and that is the RootView. If I created a mock app whose "RootView" really is "SettingsView", that SettingsView is not going to have a StackState property because it doesn't need it. However, if I created a SettingsPreview app and wanted to test out navigation within SettingsPreview, now there is nothing in its state that would allow me to push and pop subviews like before.
With an example, I believe that in one of the videos, it was discussed that the benefits of tree-based navigation is being able to do something like:
With the new navigation tools, it'd look something like this:
This works of course because
Root.State
for RootView would have apath: StackState
property in there. My question is, how can this same behavior be achieved outside of Root.State? If it can't be achieved, then I suppose that means isowords preview apps are not going to have the ability to push or pop anything from the navigation stack?Beta Was this translation helpful? Give feedback.
All reactions