![Devon Govett on X: "String union types in TypeScript have very bad inference. In this example, destructuring with a default value requires a type cast to work correctly or it will just Devon Govett on X: "String union types in TypeScript have very bad inference. In this example, destructuring with a default value requires a type cast to work correctly or it will just](https://pbs.twimg.com/media/EA6hQpGUcAIPgGb.jpg)
Devon Govett on X: "String union types in TypeScript have very bad inference. In this example, destructuring with a default value requires a type cast to work correctly or it will just
![Type incorrectly inferred as "string" rather than String Literal · Issue #22038 · microsoft/TypeScript · GitHub Type incorrectly inferred as "string" rather than String Literal · Issue #22038 · microsoft/TypeScript · GitHub](https://user-images.githubusercontent.com/24827547/36393478-c79eeba4-157d-11e8-8fc7-5aad42c90332.png)
Type incorrectly inferred as "string" rather than String Literal · Issue #22038 · microsoft/TypeScript · GitHub
![Typescript : Element implicitly has an 'any' type because expression of type 'string' can't be used to index type - TypeScript - Code with Mosh Forum Typescript : Element implicitly has an 'any' type because expression of type 'string' can't be used to index type - TypeScript - Code with Mosh Forum](https://global.discourse-cdn.com/business7/uploads/codewithmosh/optimized/2X/5/5a897a743ebf69e944acf61127117ded953ecb50_2_1024x521.png)
Typescript : Element implicitly has an 'any' type because expression of type 'string' can't be used to index type - TypeScript - Code with Mosh Forum
![Error ts2322 type 'string' is not assignable to type 'number' In typescript | #VcreationsTech - YouTube Error ts2322 type 'string' is not assignable to type 'number' In typescript | #VcreationsTech - YouTube](https://i.ytimg.com/vi/bOZNYkDQs7s/maxresdefault.jpg)
Error ts2322 type 'string' is not assignable to type 'number' In typescript | #VcreationsTech - YouTube
![Progress Component - `Type 'string' is not assignable to type 'number'.` · Issue #140 · themesberg/flowbite-vue · GitHub Progress Component - `Type 'string' is not assignable to type 'number'.` · Issue #140 · themesberg/flowbite-vue · GitHub](https://user-images.githubusercontent.com/104278083/230473078-214aef32-f264-49f3-91c9-4a6de28e7454.png)
Progress Component - `Type 'string' is not assignable to type 'number'.` · Issue #140 · themesberg/flowbite-vue · GitHub
![function - Typescript yells me that 'string | T[]' is not assignable to parameter of type 'ReadonlyArray<T> ' - Stack Overflow function - Typescript yells me that 'string | T[]' is not assignable to parameter of type 'ReadonlyArray<T> ' - Stack Overflow](https://i.stack.imgur.com/8dkA6.png)
function - Typescript yells me that 'string | T[]' is not assignable to parameter of type 'ReadonlyArray<T> ' - Stack Overflow
![How to see property available values when "string literal type" is used inside Interface in Typescript? - Stack Overflow How to see property available values when "string literal type" is used inside Interface in Typescript? - Stack Overflow](https://i.stack.imgur.com/Z76rV.png)