bookmark

dictionary - How to use enum as index key type in typescript? - Stack Overflow


Description

You can use the dialog enum values as keys, but they need to be computed properties:

let openDialogs: { [key in DialogType]?: Dialog } = { [DialogType.Options]: undefined, };

Preview

Tags

Users

  • @jil

Comments and Reviews