I have this code:
const sectionInstance: FieldValues = sectionInstances[i]
for (const field in sectionInstance) {
console.log(sectionInstance[field])
}
field
here is of course a string. Here is the type definition for FieldValues
:
export interface FieldValues = {
[key: string]: FieldValue;
}
Still I get this error:
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'FieldValues'. No index signature with a parameter of type 'string' was found on type 'FieldValues'.Vetur(7053)
Haven't I declared an index signature of type 'string' for interface FieldValues
? Why do I get this error?