Skip to content
Discussion options

You must be logged in to vote

Hi,

  1. React hook form version

First of all, the ReactJS example with react-hook-form uses "react-hook-form": "7.4.1" whereas the next js version uses "react-hook-form": "7.50". If you update to the latest version, you can observe the same behaviour; the first radio button doesn't set the default value.

Probably, it looks like the old react-hook-form's controller updates the checked like register() by refs.

  1. How to select the default value on the radio input with useController

You can simply add the defaultChecked or checked prop, but not both.

<input type="radio" {...field} value={"media"} defaultChecked />

Also, you don't need to set defaultValue again because you already give defaultV…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Moshyfawn
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