For the life of my I can't figure this one out.
I have a simple enum, here:
export enum depositTypes {
ACH = 42,
Wire = 36,
Check = 3,
Credit = 2,
}
I want to map to option tags for a select, i.e.:
Object.keys(depositTypes).map((enumKey: keyof typeof depositTypes) => <option key={depositTypes.enumKey} label={enumKey} value={depositTypes.enumKey} />)
I get an error:
Argument of type '(enumKey: "ACH" | "Wire" | "Check" | "Credit") => JSX.Element' is not assignable to parameter of type '(value: string, index: number, array: string[]) => Element'. Types of parameters 'enumKey' and 'value' are incompatible. Type 'string' is not assignable to type '"ACH" | "Wire" | "Check" | "Credit"'.
Any ideas?