ForEach / ForEachStore doesn't update UI #2290
artemkrachulov
started this conversation in
General
Replies: 1 comment
-
@artemkrachulov This definitely sounds like a SwiftUI bug, and could probably be reproduced in vanilla SwiftUI. If possible can you share a full repro of the problem? |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I found strange behavior in our application connected to
ForEachStore & SwitchStore
/ForEach & Switch
. Unfortunately, I can't provide example code in the zipped project, but I'll try to explain and add code examples for SwiftUI and TCA flows.Current flow
We have the message list which updates when a new message receives. We use a simple combination of ForEachStore and SwitchStore which switches different contents. Also for testing, I've added message count.
Bug
But we've found that if you navigate to the next screen, receive a new message and go back. The list doesn't change. Counter updates.
Testing
I tried to play with different view configurations and have some results:
switch { }
✅Probably it's more a SwiftUI issue rather than TCA, but anyway wanted to share. As a temporary solution, I'll wrap SwitchStore to ZStack. And want to repeat, it doesn't work when you trigger view updates from the next screen pushed by navigation.
Checklist
main
branch of this package.Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
The Composable Architecture version information
0.55.0
Destination operating system
16.5.1
Xcode version information
Version 14.3.1 (14E300c)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions