ReactNative Controller onChange saves event object instead of text #2985
-
In my ReactNative using const { control, handleSubmit, setError } = useForm<Contact, ApiError>()
<Controller
name="firstName"
control={control}
as={<TextInput/>}
defaultValue=""
/>
const onSend(contact: Contact) {
// contact contains the an event object for each field instead of the text values
// see below
}
<Button onPress={handleSubmit(onSend)}/>
This is what
Also there is a warning displayed saying "this synthetic event is reused for perfomance reasons..." While the stack of the warning does not reveal anything about |
Beta Was this translation helpful? Give feedback.
Answered by
bluebill1049
Sep 23, 2020
Replies: 1 comment 3 replies
-
hey @pke use |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
pke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hey @pke use
render
instead.https://react-hook-form.com/api#Controller