function useTextField<TClient extends ViewClient>(view: TextFieldView<TClient>, read: (state: TClient["snapshot"]) => string, write: (client: TClient, value: string) => Promise<unknown>, options?: UseTextFieldOptions): TextFieldHandle; Binds a controlled text input to one member of a View while the component is mounted, through createTextFieldController. Typing key by key never loses characters: while its writes are in flight the field shows what the user typed, at most one write is in flight (newer text is written next), nothing is written during IME composition, and once the last write settled it shows the View's value, including any normalization. read and write may close over render values; the latest ones are used.
const person = useView(page);
const name = useTextField(person, state => state.name, (client, value) => client.setName(value));
<input value={name.value} onChange={name.onChange}
onCompositionStart={name.onCompositionStart} onCompositionEnd={name.onCompositionEnd} />write may be a generated setter, a command or a checked write. Its failure, and a checked write's rejected or conflict receipt, keep the draft and set error (a receipt's is a FieldError). For a generated member, prefer useField with its {View}Fields descriptor. Unmounting writes text that waits for a write in flight, and stops updating the handle.