Skip to content
Discussion options

You must be logged in to vote

@oualidmaz

The react-datepicker implement a custom "ref" for its default input element therefore "ref" handling from "react-hook-form" is not triggered. You can set the "ref" from the parent component as a workaround for this case.

Working sample: https://codesandbox.io/s/react-hook-form-focus-forked-yyhsi?file=/src/index.js

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@oualidmaz
Comment options

@thanh-nguyen-95
Comment options

@oualidmaz
Comment options

Comment options

You must be logged in to vote
4 replies
@oualidmaz
Comment options

@Markus1607
Comment options

@michaelcais
Comment options

@ZHaas
Comment options

Answer selected by oualidmaz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants