MCPcopy
hub / github.com/react-hook-form/react-hook-form / App

Function App

examples/V6/parseFormatInputValues.tsx:17–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15};
16
17export default function App() {
18 const { control, handleSubmit } = useForm();
19 const onSubmit = (data) => {
20 console.log(data);
21 };
22
23 return (
24 <form onSubmit={handleSubmit(onSubmit)}>
25 <Controller
26 name="emails"
27 as={ParseFormatTextarea}
28 control={control}
29 defaultValue={[]}
30 />
31
32 <Controller
33 name="number"
34 render={({ value, onChange }) => (
35 <input
36 type="number"
37 value={value}
38 onChange={(e) => onChange(parseInt(e.target.value, 10))}
39 />
40 )}
41 control={control}
42 defaultValue={0}
43 />
44
45 <button type="submit">Submit</button>
46 </form>
47 );
48}

Callers

nothing calls this directly

Calls 3

useFormFunction · 0.85
handleSubmitFunction · 0.85
onChangeFunction · 0.85

Tested by

no test coverage detected