When using Flow Types:
export type GroupType = {
options: OptionsType,
[string]: any,
};
What does the syntax [string]: any
signify?
Edit :
Appreciate all the responses provided.
How should I interpret this particular piece of code?
import type { GroupType } from './types';
const formatGroupLabel = (group: GroupType): string => group.label;
To me, formatGroupLabel
seems to be a function that takes the parameter group
and returns group.label
. However, I'm unsure about the significance of : string
before (group: GroupType)
. It may not be related to my initial question.