I am new to yup validation, and I am populating the react-select dropdown with the below options. and now when I click on one button trying to validate if any value is selected or not. but it is not validating. any help is much appreciated.
const options = [
{ value: 'active', label: 'Active' },
{ value: 'inactive', label: 'In Active' },
{ value: 'deleted', label: 'Delete' },
];
<Select
defaultValue={options[0]}
isSearchable={false}
className="react-dropdown"
onChange={statusDropdownHandleChange}
classNamePrefix="dropdown"
options={options}
name="status"
{...register("status")}
/>
let schema = yup.object().shape({
status: yup.object().shape({
label: yup.string().required("status is required"),
value: yup.string().required("status is required")
})
});