Replies: 2 comments
-
My response on #998 might help you, although it is in TypeScript |
Beta Was this translation helpful? Give feedback.
0 replies
-
@olegKusov This might help you useEffect(() => {
// custom register react-day-picker
register({ name: 'date' }, { required: true });
setValue('date', new Date());
// unregister input after the component unmounts
return () => unregister('date');
}, [register, unregister, setValue]);
const handleDayPickerDateChange = (date) => {
setValue('date', date);
};
<DayPickerInput
component={React.forwardRef((props, ref) => {
return <TextInput ref={ref} {...props} />
})}
onDayChange={handleDayPickerDateChange}
/> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using React Hook Form, there i need to push ref to my input component. Is it way to handle this ref in DayPickerInput component prop?
Beta Was this translation helpful? Give feedback.
All reactions