How SwiftUI StateObject and React useState defer initial value evaluation
Issue #991
When building apps in SwiftUI or React, we often need to store values that change — like a counter, user input, or a list of items.
To do this:
- React gives us
useState
. - SwiftUI gives us
@State
and@StateObject
.
But here’s something cool: …