Skip to content
Discussion options

You must be logged in to vote

Haven't looked at your code closely yet, but from what I see, the way you're using HOC is bad, meaning you re-init your component inside HOC every render, hence RHF looses the input's ref, hence you don't get the focus on your input.

You should avoid initing your components / HOCs inside the func component's body during the render phase. It's not specific to how RHF works, but the general React behavior

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Aditya000786
Comment options

@Moshyfawn
Comment options

@Aditya000786
Comment options

@Aditya000786
Comment options

@Aditya000786
Comment options

Answer selected by Aditya000786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants