Hey TCA community :)
I have a very simple use case which I want to realise with the composable architecture.
Imagine remotely browsing a folder structure where the content of a folder is a loaded as soon as you navigate to it.
I digged through different threads here, mainly Recursive reducer on optional sub-states and Recursive navigation - #6 by maximkrouk and tried to implement a similar approach.
You can find my test project on Github: GitHub - j0h4nn3s/RecursiveBrowsingComposableArchitecture: Test projects to test recursive browsing with the composable architecture.
It looks like I am missing something; when I am navigating deeper than three levels I receive an unexpected action (which resets the navigation stack in the state and therefor breaks the app) but I cannot figure out where it is coming from.
I expect to receive a navigate action from the third level:
FolderAction.subFolder(
FolderAction.subFolder(
FolderAction.navigateTo(
9
)
)
)
which I do in fact receive. But at the same time I also receive this action:
FolderAction.subFolder(
FolderAction.navigateTo(nil)
)
which I would only expect when popping something from the navigation stack.
Has anybody here implemented something similar and can see where I made a mistake? Any help is appreciated.
Edit: I think I figured it out. Seems to be this bug: Deep nested navigation - #2 by grinder81 and adding .navigationViewStyle(StackNavigationViewStyle())
to the NavigationView seems to do the trick.