OnBlur React Native with @react-native-community/datetimepicker #1984
Answered
by
bluebill1049
JanderSilv
asked this question in
Q&A
-
I'm using the DateTimePicker's package, and I've tried to use it with a Controller for have the OnBlur Validation, but I guess that isn't posible. With the Custom Register in the React Native, we don't have the onBlur and onChange validation yet. There is some way to achieve these kind of validation with the Custom Register? My solution with the Controller that doesn't work: const setDate = (args) => {
setDatePickerIsOpen(false);
setBirthday(args[1]);
};
<Controller
as={
<DateTimePicker
mode="date"
value={new Date()}
locale="pt-BR"
onChange={(
event,
date
) =>
setDate(
event,
date
)
}
/>
}
control={control}
name="birthday"
onChange={(args) =>
setDate(args)
}
rules={{ required: true }}
defaultValue={new Date()}
/> |
Beta Was this translation helpful? Give feedback.
Answered by
bluebill1049
Jun 28, 2020
Replies: 1 comment 1 reply
-
we are going to support render props with Controller, will that help? https://github.com/react-hook-form/react-hook-form/releases/tag/v6.0.0-rc.2 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
JanderSilv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
we are going to support render props with Controller, will that help?
https://github.com/react-hook-form/react-hook-form/releases/tag/v6.0.0-rc.2