You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional context
We can create codemod for TypedController (from @hookform/strictly-typed package). It was working very similar way as a new Controller.
Thanks @lionskape Do you have more example to migrate ? I think it's hard to handle all uses cases.
We can use useController too in replacement of useTypedController
@jorisre Unfortunately, useController is not a replacement of useTypedController. useTypedController creates a component, but useController creates an object.
@bluebill1049 can you explain, what is a problem with name? Seems like we have to change array notation to the template string.
Activity
jorisre commentedon Mar 15, 2021
Thanks @lionskape Do you have more example to migrate ? I think it's hard to handle all uses cases.
We can use
useControllertoo in replacement ofuseTypedController@bluebill1049 what's your thoughts ?
bluebill1049 commentedon Mar 15, 2021
I am not codemod expert, I would assume migrate useTypedController would be tricky due to the input name itself is an array.
lionskape commentedon Mar 15, 2021
@jorisre Unfortunately, useController is not a replacement of useTypedController. useTypedController creates a component, but useController creates an object.
@bluebill1049 can you explain, what is a problem with name? Seems like we have to change array notation to the template string.
By the way - it would be very useful, because useTypedController will no longer be maintained react-hook-form/strictly-typed#29 (comment)
bluebill1049 commentedon Mar 15, 2021
That's the problem which you have described, I think for any exiting useTypedControlled, you will have to manually convert to just useController.