DEV Community

Discussion on: Forms in React: React Hook Forms with Material UI and YUP

Collapse
 
ammartinwala52 profile image
Ammar Tinwala

Hi Ndrean

Thank you for your time in reading this. I apologize for my very very delayed response.

register method can be used with any UI element that exposes a ref for register method. The reason I used Controller is because if you are using a Controlled component, then your workflow becomes very easy to integrate.

The form controls that I have created you can easily swap it with any other 3rd party UI library instead of Material UI and the core logic with "React Hooks Form" library will remain the same.
With this view in mind I have used the Controller component.