import { VStack, Button, FormControl, PinInput } from 'native-base'; import React from 'react'; import { useForm, Controller } from 'react-hook-form'; interface IFormInput { otp: string; } export const Example = () => { const { control, handleSubmit, errors } = useForm(); const onSubmit = (data: IFormInput) => { console.log('submiting with ', data); }; return ( OTP: ( onChange(val)} value={value}> )} name="otp" rules={{ required: 'Field is required', minLength: 4, maxLength: 4 }} /> {errors.otp?.message} ); };