Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid excessive view computation with
@Bindable
(#123)
Because our `@Bindable` holds onto a reference, this reference is probed by SwiftUI to determine if a view body should be recomputed, and since the creation of the view is going to create a whole new reference, it is invalidating the view and causing it to re-render. Instead, lets treat these references as equal if the objects they wrap are equal. This doesn't make things completely 1:1 with SwiftUI, as there is an initial invalidation in the parent, but a single extra invalidation seems like a good improvement. Fixes #122.
- Loading branch information