jakezatecky / react-dual-listbox

A feature-rich dual listbox for React.
https://jakezatecky.github.io/react-dual-listbox/
MIT License
109 stars 59 forks source link

Integrate in a form using react-hook-form #214

Closed asifka closed 1 year ago

asifka commented 1 year ago

how can I integrate with react-hook-form? I need to validate the dual list and submit data using the hook form

Thanks

jakezatecky commented 1 year ago

I have never used that library, but from my understanding (which could be wrong) you can just register this component.

There is an underling <input> within this component the pairs with the name property. This component also uses the standard value, required, and disabled properties that a normal HTML form element would use, so I assume it should work with react-hook-form either out of the box or with some minor tweaking.

If someone encounters an issue and can suggest a modification to make this component integrate with react-hook-form, then I can I accommodate such changes. Otherwise, I will assume this is a userland implementation.