I have an object that looks like this
interface ProvideFeedbackFormProps {
feedbackNature: FormikDropdownProps
waybillNumber: FormikDropdownProps
provideFeedback: FormikDropdownProps
editorState?: string
attachments?: string[]
}
and FormikDropdownProps looks like this
interface FormikDropdownProps {
id: number
value: string
}
When I run a loop on data that implements the above structure (values below is of type ProvideFeedbackFormProps), like so
for (const property in values) {
const customField = values[property]
customFields.push(customField)
}
I get an error at values[property] that says
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'ProvideFeedbackFormProps'.
No index signature with a parameter of type 'string' was found on type 'ProvideFeedbackFormProps'
Questions
- What is causing this behavior?
- How can I fix it?