-
X-posting from chakra-ui/chakra-ui#3724 I'm trying to build a Chakra-UI custom radio group component that also needs to submit values to RHF v6. I have a CodeSandbox forked from the RHF example in the Guides section, and I'm having trouble getting a custom radio group to register with RHF. https://codesandbox.io/s/chakra-ui-react-hook-form-custom-radio-2un9h?file=/src/HookForm.js Has anyone had success getting these 2 woking together? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hi @paambaati 👋🏻 You should use Here is a working example with |
Beta Was this translation helpful? Give feedback.
-
have a look at this example too: https://codesandbox.io/s/chakra-ui-5mp8g |
Beta Was this translation helpful? Give feedback.
-
I've got an alternative solution here: https://codesandbox.io/s/react-hook-form-v7-custom-chakra-radio-group-rhc6q |
Beta Was this translation helpful? Give feedback.
Hi @paambaati 👋🏻
You should use
Controller
oruseController
.Here is a working example with
useController
: https://codesandbox.io/s/chakra-ui-react-hook-form-custom-radio-forked-xve7r👉🏻
useController
doc👉🏻
Controller
doc