-
-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Checklist
- Reviewed the README and documentation.
- Checked existing issues & PRs to ensure not duplicated.
Description
@StateObject is slightly less performant than @State due to the overhead of resubscribing the subtree's ObservableObjects when updating the parent view.
However, Swift5's actor isolation inference seems to have a special behavior when using @StateObject (views that depend on @ViewContext indirectly through other dynamic properties are not isolated to the main actor), and I found out that it breaks backward compatibility.
Most likely it's a bug, but fortunately the actor isolation inference for property wrapper will be removed in Swift6, so then we can replace state management using @StateObject with @State.
Example Use Case
N/A
Alternative Solution
No response
Proposed Solution
No response
Motivation & Context
No response
riley-usagi
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request