yup typescript image file validation
import React from “react”; import { useForm } from “react-hook-form”; import { yupResolver } from “@hookform/resolvers/yup”; import * as yup from “yup”; interface MyFormType { image: FileList | null; } const defaultValues: MyFormType = { image: null, }; const validationSchema:yup.ObjectSchema<MyFormType> = yup.object({ image: yup.mixed<FileList|null>().nullable() }); const MyForm: React.FC = () => { const { register, […]