Recipes
Basic Submit
Handle form submission with success and error callbacks.
Basic Submit
form.submit returns an event-handler-friendly function. Call it from your submit handler after preventing the browser default.
import { , } from '@oxform/react';
import { } from 'zod';
const = .({
: .(),
});
export function () {
const = ({
,
: {
: '',
},
});
return (
<
={ => {
.();
void .(
=> {
.(.);
},
=> {
.(.);
},
)();
}}
>
< ={} ='email'>
{ => < ='email' {....} />}
</>
< ='submit'>Create account</>
</>
);
}