Replies: 3 comments
-
There is an example about recursion in the case studies. Maybe it'll help. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Going to convert this to a discussion, but the examples above should help 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is fairly common to have one view pushes same view to navigation stack. For example A ProductDetailView can contain similar products section. And tapping a product in similar products sections pushes a new ProductDetailView to navigation view. It is easy to implement it in vanillia SwiftUI. Just create a new instance and give it to destination of NavigationLink.
But I am having struggle to achieve same thing in TCA. I need to embed the child view's state to parent view's state in order to trigger navigation. This is the ProductDetailState:
But because it is struct and structs can not recursively contain their instances I get compile error. I tried to convert state to final class but this time views didn't update.
Am I missing something? How can achieve this in TCA?
Beta Was this translation helpful? Give feedback.
All reactions