The old binding syntax was, (for example), TextField("Name", text: viewStore.binding(get: \.text, send: { .updateText($0) }))
.
Since the ViewStore
is no more, what's the new binding syntax?
The old binding syntax was, (for example), TextField("Name", text: viewStore.binding(get: \.text, send: { .updateText($0) }))
.
Since the ViewStore
is no more, what's the new binding syntax?
After digging into the Composable Architecture slack channel it appears that
TextField("enter text here", text: $store.text.sending(\.updateText).animation()
is the new syntax.This relies on decorating the
StoreOf<YourFeature>
with an@State
or@Bindable
property wrapper.animation()
can be omitted, or provided with an optional parameter.