this code I can't understand one thing. If we will remove string & at line 2, TS will warn us at line 3 that Type 'string' is not assignable to type 'number'. However, if PropEventSource will be a non-generic type, and we will add some type or interface with fields (e.g. type Test = { 0: string; strField: boolean }), after replace Type at line 2-3 to Test, it's going to work. Why does the generic type not work and require string &?
Sry for my English))
You mean the second line?
Обсуждают сегодня