0

When typing this in Visual Studio Code:

enter image description here

I expect Key to be string but it is string | number. Why?

Guerric P
  • 30,447
  • 6
  • 48
  • 86
  • 1
    Does this answer your question? [Keyof inferring string | number when key is only a string](https://stackoverflow.com/questions/51808160/keyof-inferring-string-number-when-key-is-only-a-string) – Sadaf Niknam Mar 22 '20 at 14:59
  • Workaround is - `Record`, and the behavior you have is by design – Maciej Sikora Mar 22 '20 at 15:01

0 Answers0