in my React
application I have a few types:
export interface LocaleData {
languages: Languages, // shows error here
[stringKey: string]: Strings
}
export interface Languages {
[languageKey: string]: string
}
export interface Strings {
login: {
headerGreeting: string,
firstStepGeneralMessage: string,
cellNumber: string,
cellNumberError: string,
areaCodePref: string,
canContinue: string,
signoutAlertTitle: string,
signoutAlertContent: string,
signoutPositiveButton: string
},
////
}
Now, the code works and all, but I get an error that says:
Property 'languages' of type 'Languages' is not assignable to string index type 'Strings'.
I can't figure out what's wrong with the provided code and how to avoid this error?