BindableState
changes are not corrected reflected on first appearance of the hosting View
#1120
-
Describe the bug
Note: To Reproduce Expected behavior Environment
Additional context
Work Around
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Hello @ylorn! There is a gotcha with Edit: No need to be ashamed: you can see myself tripping into it a few months ago: #801 … |
Beta Was this translation helpful? Give feedback.
-
Yeah, I think @tgrapperon hit the nail on the head! Gonna close out this issue and move it to a discussion. 😃 |
Beta Was this translation helpful? Give feedback.
-
This is new to me. It seems Thanks and sorry for the fuss, SwiftUI newbie here 😅 |
Beta Was this translation helpful? Give feedback.
-
I tried both replacing the Can you teach me the correct way to send the action |
Beta Was this translation helpful? Give feedback.
Hello @ylorn!
There is a gotcha with
Group
: modifiers you apply to it are effectively applied to each child. In your case, you end up sending.viewAppear
twice, causing weird race conditions. You can check this by appending.debugActions()
to your reducer. The issue will go away if you replace your group by aVStack
for example, or limit.onAppear
to only one child.Edit: No need to be ashamed: you can see myself tripping into it a few months ago: #801 …