-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicated/invalid actions are received when tab view appear #2
Comments
This is a strange issue indeed. It's hard to tell if this is a bug in SwiftUI or a problem with ComposableArchitecture. It seems to be only reproducible when action is sent inside As a workaround (which I can confirm solves the problem) we can move |
Description
Reported by @saroar in a comment to another issue.
Steps to reproduce
onAppear
actions to each component.onAppear
action to theViewStore
inside.onAppear(perform:)
modifier in each view..none
effect whenonAppear
action is received.Expected behavior
onAppear
action of the currently selected tab's component should be received.Actual behavior
onAppear
action is received, for example when switching from "Color" to "Shape" tab, instead of singleShapeAction.onAppear
, two actions are received:ShapeAction.onAppear
and thenPreviewAction.onAppear
.Testing notes
The issue occurs only when action is sent to the
ViewStore
in.onAppear(perform:)
modifier. When not sending the action in the closure (but for example just printing something to the console) - everything is working as expected.The text was updated successfully, but these errors were encountered: