摘要:
type WidenLiteral<T> = T extends string | number | boolean ? ReturnType<T["valueOf"]> : T; type Example1 = WidenLiteral<"abc"> // string type Example2 阅读全文
摘要:
Omit on Union type type Union = | { a: "a"; user?: string; } | { b: "b"; user?: string; }; type X = Omit<Union, "user">; // X is {} Using Distributive 阅读全文
摘要:
Fix forwardRef globally To jump ahead to the solution, uncommenting the following code from Stefan Baumgartner will globally override the value of for 阅读全文