re: Hookify Your React Forms VIEW POST


What if I have to use a custom input? Like a custom upload control, checkbox group, etc. I couldn't find anything in their docs


Check out this Controller Component: react-hook-form.com/api#Controller

React Hook Form embraces uncontrolled components and native inputs, however it's hard to avoid working with external controlled component such as React-Select, AntD and Material-UI. This wrapper component will make it easier for you to work with them.


With a custom upload control, you would just attach the validation to the real (hidden) file input then reflect any error statuses beside the "fake" input the same as illustrated here.

Im not sure about checkbox groups, but Ill do a little research and experimentation and see what I can discover.


After digging in their github issues / spectrum chat for a little while, I was able to find an example that I think is what you are looking for in regards to checkboxes.


code of conduct - report abuse