Replies: 1 comment 6 replies
-
Hi @jondlew, it's hard to know what is going on with a minimal reproducing project that demonstrates the behavior you are seeing. Can you create one and share it? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When @State for a view needs to be initialized between modules, the view must have a public init. This requires @State to have an initial value set.
My test app has a ParentFeature (module) presenting a ChildFeature(module), with the parent setting the childValue UUID in state prior to presenting.
I'm seeing that init is working, with the store using the correct parent derived UUID.
However, the view is using a different UUID (I assume the one set in @State).
Also, the dismiss dependency in the ChildFeature fails to work, with the log stating:
I'm seeing the same behavior if I use a NavigationStack with the ChildFeature as well. Both an incorrect UUID and dismiss fail to work.
Here's the ChildFeature for reference:
The app behaves correctly if the features aren't modularized and the public init() on the views can be avoided.
Is there something different I should be doing with @State initialization?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions