Capítulo 21 de 29
No special configuration is needed for React Native — the library is headless enough that TextInput/Text wire up through the exact same form.Field render-prop pattern as any web <input>.
@tanstack/react-native-form package; the standard @tanstack/react-form is used directly.field.state.value, field.handleChange, and error display via field.state.meta.errors, just bound to TextInput.onChangeText instead of an <input>'s onChange.document.querySelector, so focus-on-error requires manual ref tracking.<form.Field
name="age"
validators={{ onChange: (val) => (val < 13 ? 'You must be 13 to make an account' : undefined) }}
>
{(field) => (
<>
<Text>Age:</Text>
<TextInput value={field.state.value} onChangeText={field.handleChange} />
{!field.state.meta.isValid && <Text>{field.state.meta.errors.join(', ')}</Text>}
</>
)}
</form.Field>
TextInput/onChangeText instead of DOM equivalents.@tanstack/react-form itself is the one to install.onChangeText vs onChange) — validators, listeners, arrays, and composition patterns from every other chapter apply unchanged.