eduardoborges / use-mask-input

✏️ A react Hook for build elegant input masks. Compatible with React Hook Form
https://npmjs.com/package/use-mask-input
332 stars 19 forks source link

'Usage with React Hook Forms' correction #49

Closed Berohlfs closed 1 year ago

Berohlfs commented 1 year ago

Hello! My name is Bernardo. I'm from Brazil.

First of all, I would like to thank you. Honestly, this library was exactly what I was looking for... and it really does work like a charm with react-hook-form.

There is only one extremely small issue, in the documentation, that I felt the need to point out. I may be mistaken, but my code only worked after I made the following correction:

import React from 'react';
import { useForm } from 'react-hook-form';
import { withHookFormMask } from 'use-mask-input';

function App() {
  const { register, handleSubmit } = useForm();
  const registerWithMask = useHookFormMask(register);

  ...
eduardoborges commented 1 year ago

Hey @Berohlfs! Thank you for your contribuition. By the way, i'm also Brazilian! (é noiz). I will fix this doc issue now.

Thank you again!