()
| 15 | }; |
| 16 | |
| 17 | export 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 | } |
nothing calls this directly
no test coverage detected