I am currently making a component in React and one of the properties is called 'initNavData'. This is an object where the property names will always be different names and there are an unknown amount of these properties. Each of them will have the same structure though. How can I create a type for this?
I saw the [x: string] suggestion, but will this allow for an unlimited amount of properties?
interface WizardProps {
id: string;
// parentWizard: string
isSubwizard: boolean;
wizardName: string;
initNavData: {
[x: string]: {
label: string;
status: string;
current: boolean;
active: boolean;
icon: string;
key: string;
}
}
}