You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AsyncButton action uses the initial view value #23
Thanks for ButtonKit, it’s a really useful library.
I encountered unexpected behavior when a value passed into a child view changes. The UI displays the updated value, but AsyncButton still uses the value captured during its initial render.
struct ContentView: View {
@State private var value = 0
var body: some View {
VStack {
Button("Increment") { value += 1 }
Text("Value: \(value)")
ChildView(value: value)
}
}
}
struct ChildView: View {
let value: Int
var body: some View {
AsyncButton {
print("Value:", value)
} label: {
Text("Print")
}
}
}
Activity
Dean151 commentedon Aug 5, 2026
Hi!
Thanks for reaching out.
This was not the intended behavior, thanks for reporting it!
I've published a fix in 0.8.1 for this
fix(button): use the latest action closure instead of the one capture…
fix(button): use the latest action closure instead of the one capture…