Form Docs
AI/LLM: This documentation page is available in plain markdown format at/form/latest/docs/framework/react/guides/react-native.md
Guides
Usage with React Native
TanStack Form is headless and it should support React Native out-of-the-box without needing any additional configuration.
Here is an example:
tsx
<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>