verschachtelte Objekte in Strömungsart
export type TOption = {
input_type: string,
label: string,
option_id: string,
value: any
};
export type TOptions = {
[key: string]: TOption
};
Ich versuche, einen Typen zu definieren, die ein Objekt ist, das eine dynamische Anzahl von Schlüssel-Wert-Paaren aufweist, wobei jeder Wert ein Objekt mit INPUT_TYPE, Etikett, option_id, Wert
jedoch Fluss wirft nicht kompatiblen Typ Fehler
Property `option_id` is incompatible:
19: [key: string]: TOption
^^^^^^^ object type. This type is incompatible with
14: option_id: string,
^^^^^^ string
Ich denke, dass ich es falsch bin definieren, aber ich bin nicht sicher, wie es zu definieren. Kann jemand auf das Problem hinweisen?
interessant. Ich muss weiter darauf schauen, warum meine Version mit Flow ausfällt – Victor