Closed lisindima closed 3 weeks ago
Thanks for raising this @lisindima - it was indeed a bug in the library code. I have made a change in v0.6.2 that should resolve the issue.
Side note: there is another issue with the example code you posted:
.flowDestination(for: Path.self) { screen in
switch screen {
case let .one(value):
TestView(coordinator: .init(), value: value)
}
}
Because you're initialising a new coordinator each time this closure is called, the child coordinator will soon get replaced by one with an empty path, popping the screen. You could prevent this by including the coordinator in the parent's path (e.g. case one(Int, SecondCoordinator)
) or by keeping hold of it in the first coordinator, so that it remains stable. It seems like NavigationStack
behaves differently though (see https://github.com/johnpatrickmorgan/NavigationBackport/issues/47), so there should maybe be a change in this library to not call the closure multiple times.
Thank you very much for the quick fix!
Hi, thanks for the great library. I'm trying to implement navigation with nested coordinators. My project is divided into modules, each module has its own coordinator, and there is also a root coordinator that creates all the others. There is an example of code that causes an error: Fatal error: No view builder found for type NewPath. I provide you with a minimal example to reproduce the error
Is this a library bug or a bug in my implementation?