diff --git a/docs/framework/react/guides/react-native.md b/docs/framework/react/guides/react-native.md index e33d5a44d..952f06421 100644 --- a/docs/framework/react/guides/react-native.md +++ b/docs/framework/react/guides/react-native.md @@ -8,21 +8,36 @@ TanStack Form is headless and it should support React Native out-of-the-box with Here is an example: ```tsx - - val < 13 ? 'You must be 13 to make an account' : undefined, - }} -> - {(field) => ( - <> - Age: - - {field.state.meta.errors ? ( - {field.state.meta.errors.join(', ')} - ) : null} - - )} - +import { Text, View, TextInput } from 'react-native'; +import { useForm } from "@tanstack/react-form"; + + +export default function App() { + //Doesnt work even if changed to "Form" instead of "form" + const form = useForm({ + defaultValues: { + name: "", + }, + onSubmit: async ({ value }) => { + // Do something with form data + console.log(value); + }, + }); + return ( + + ( + Enter a name! + field.handleChange(e)} + /> + )} + /> + + ); +} + ```