Extremely strange TS behaviour someone just DM'd me.
Adding | [] to a generic type parameter seems to infer the type as a tuple, instead of an array!
Pretty weird, and quite useful to know about!

Source: x.com/mattpocockuk/status/1834627340329951251
Extremely strange TS behaviour someone just DM'd me.
Adding | [] to a generic type parameter seems to infer the type as a tuple, instead of an array!
Pretty weird, and quite useful to know about!

Source: x.com/mattpocockuk/status/1834627340329951251
No replies yet.