You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's use React Happy Form to build your first form!
import{useForm,native}from'react-happy-form';// define your form values typetypeFormValues={firstName?: string;lastName?: string;email?: string;};exportconstApp=()=>{const{ field, submit }=useForm<FormValues>({// handle form submitonSubmit: (values: FormValues)=>{alert(JSON.stringify(values));},});return(<div><h2>Example Form</h2><formonSubmit={submit}>{/* use built-in native wrapper for native elements */}<input{...native(field('firstName'))}placeholder="First name"/><input{...native(field('lastName'))}placeholder="Last name"/><input{...native(field('email'))}placeholder="Email"/><button>Submit</button></form></div>);};