import {InputOtp} from "@heroui/react"; import {useForm, Controller} from "react-hook-form"; import {Button} from "@heroui/react"; export default function App() { const { handleSubmit, control, formState: {errors}, } = useForm({ defaultValues: { otp: "", }, }); const onSubmit = (data) => { alert(JSON.stringify(data)); }; return (
( )} rules={{ required: "OTP is required", minLength: { value: 4, message: "Please enter a valid OTP", }, }} /> ); }