use-mask-input
use-mask-input copied to clipboard
Integrate with react-hook-form `control`
We are using the controlled version for react-hook-form by using useControl
hook. it would be awesome if we can use useHookFormMask
with control
too
You can use it. Just re-subscribing ref value using withMask function
<Controller
name="test"
render={({ field }) => {
return <input {...field} ref={withMask('9999-9999')}/>; // ✅
}}
/>
Hey @hanza93 im working on it, but for now you can use withMask
like @alysonvilela demostrate above. <3
@alysonvilela is problem with this solution because if you pass withMask as ref then primary functionality that scroll and focus element with errors stop working i mean if you set shouldFocusError
to true