Skip to content

Commit

Permalink
docs(quick-start): add <form> tag to quick start example (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-bakes authored Oct 17, 2023
1 parent 0159e61 commit 119ce68
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions docs/framework/react/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,28 @@ export default function App() {
return (
<div>
<form.Provider>
<div>
<form.Field
name="fullName"
children={(field) => (
<input
name={field.name}
value={field.state.value}
onBlur={field.handleBlur}
onChange={(e) => field.handleChange(e.target.value)}
/>
)}
/>
</div>
<button type="submit">Submit</button>
<form
onSubmit={(e) => {
e.preventDefault();
e.stopPropagation();
void form.handleSubmit();
}}
>
<div>
<form.Field
name="fullName"
children={(field) => (
<input
name={field.name}
value={field.state.value}
onBlur={field.handleBlur}
onChange={(e) => field.handleChange(e.target.value)}
/>
)}
/>
</div>
<button type="submit">Submit</button>
</form>
</form.Provider>
</div>
)
Expand Down

0 comments on commit 119ce68

Please sign in to comment.