Yup is a JavaScript object schema validator and object parser. To check if the file uploaded is of the correct type and not exceeding the maximum file size allowed to upload using Yup, you can do: const MAX_FILE_SIZE = 102400; //100KB
const validFileExtensions = { image: ['jpg', 'gif', 'png', 'jpeg', 'svg'…