function App() { const { register, handleSubmit } = useForm(); const onSubmit = data => console.log(data); return ( <> <form onSubmit={handleSubmit(onSubmit)}> <label htmlFor="name">Naam</label> <input {...register("firstName")} /> <select {...register("gender")}> <option value="female">female</option> <option value="male">male</option> <option value="other">other</option> </select> </form </> ); } export default App;
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter