Description
Reported by @saroar in a comment to another issue.
Steps to reproduce
- Add
onAppear actions to each component.
- Send the
onAppear action to the ViewStore inside .onAppear(perform:) modifier in each view.
- In each of the reducers, just return
.none effect when onAppear action is received.
- Run the app and randomly switch tabs.
Expected behavior
- Whenever tab is switched,
onAppear action of the currently selected tab's component should be received.
Actual behavior
- Sometimes wrong
onAppear action is received, for example when switching from "Color" to "Shape" tab, instead of single ShapeAction.onAppear, two actions are received: ShapeAction.onAppear and then PreviewAction.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.
Description
Reported by @saroar in a comment to another issue.
Steps to reproduce
onAppearactions to each component.onAppearaction to theViewStoreinside.onAppear(perform:)modifier in each view..noneeffect whenonAppearaction is received.Expected behavior
onAppearaction of the currently selected tab's component should be received.Actual behavior
onAppearaction is received, for example when switching from "Color" to "Shape" tab, instead of singleShapeAction.onAppear, two actions are received:ShapeAction.onAppearand thenPreviewAction.onAppear.Testing notes
The issue occurs only when action is sent to the
ViewStorein.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.