()
| 42 | }; |
| 43 | |
| 44 | export default function App() { |
| 45 | const { |
| 46 | handleSubmit, |
| 47 | formState: { errors }, |
| 48 | control, |
| 49 | } = useForm({ |
| 50 | reValidateMode: 'onSubmit', |
| 51 | defaultValues: { |
| 52 | ControlledMaskedInput: '7', |
| 53 | }, |
| 54 | }); |
| 55 | return ( |
| 56 | <div className="App"> |
| 57 | <form onSubmit={handleSubmit(onSubmit)}> |
| 58 | <div> |
| 59 | <Controller |
| 60 | render={({ field }) => <CustomMaskedInput {...field} />} |
| 61 | rules={{ |
| 62 | validate: { |
| 63 | inputTelRequired: isNotFilledTel, |
| 64 | }, |
| 65 | }} |
| 66 | name="ControlledMaskedInput" |
| 67 | control={control} |
| 68 | /> |
| 69 | |
| 70 | {errors.ControlledMaskedInput && ( |
| 71 | <p>{errors.ControlledMaskedInput.message}</p> |
| 72 | )} |
| 73 | </div> |
| 74 | <input type="submit" /> |
| 75 | </form> |
| 76 | </div> |
| 77 | ); |
| 78 | } |
nothing calls this directly
no test coverage detected