export const validationSchema = (): FormValidationSchema => { const validationObject: { [key: string]: StringSchema } = {} // validation schema keys based on the name prop of the radio buttons in the form HOBBIES.forEach((hobby) => { validationObject[hobby.stateName] = Yup.string().required() }) return Yup.object(validationObject) }