Skip to content

Commit 0794d2c

Browse files
author
JWI
committed
idk
1 parent a68ced4 commit 0794d2c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Sources/SwiftCrossUI/ViewGraph/ViewGraphNode.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,17 @@ public class ViewGraphNode<NodeView: View, Backend: AppBackend>: Sendable {
169169

170170
private func updateEnvironment(_ environment: EnvironmentValues) -> EnvironmentValues {
171171
var newEnvironment = environment
172-
// Directly assign the closure instead of using keypath
173-
newEnvironment.onResize = { [weak self] newSize in
174-
guard let self = self else { return }
172+
173+
// Strong capture of self (no weak)
174+
newEnvironment.onResize = { newSize in
175175
self.bottomUpUpdate()
176176
}
177+
177178
return newEnvironment
178179
}
179180

180181

182+
181183
/// Recomputes the view's body, and updates its widget accordingly. The view may or may not
182184
/// propagate the update to its children depending on the nature of the update. If `newView`
183185
/// is provided (in the case that the parent's body got updated) then it simply replaces the

0 commit comments

Comments
 (0)