@br-validators/react-hook-form

React Hook Form rules and resolvers that delegate to @br-validators/core v1.10.0.
Install
pnpm add @br-validators/react-hook-form @br-validators/core react react-hook-form
Register + validate rule
import { useForm } from 'react-hook-form';
import { cpfRule } from '@br-validators/react-hook-form';
const { register } = useForm<{ cpf: string }>();
<input {...register('cpf', cpfRule({ required: 'CPF is required' }))} />;
Resolver
import { useForm } from 'react-hook-form';
import { cpfResolver } from '@br-validators/react-hook-form';
const form = useForm<{ cpf: string }>({ resolver: cpfResolver() });
Invalid values surface the same message string returned by core validate*.
License
MIT