Matt Pocock on X: "🔥 TypeScript Tip #7 🔥
🧑💻 Beginner/intermediate
💡 Generics
The looseness of Object.keys can be a real pain point when using TypeScript. Luckily, it's pretty simple to create a tighter version using generics and the keyof operator."
🔥 TypeScript Tip #7 🔥
🧑💻 Beginner/intermediate
💡 Generics
The looseness of Object.keys can be a real pain point when using TypeScript. Luckily, it's pretty simple to create a tighter version using generics and the keyof operator.
🔥 TypeScript Tip #7 🔥
🧑💻 Beginner/intermediate
💡 Generics
The looseness of Object.keys can be a real pain point when using TypeScript. Luckily, it's pretty simple to create a tighter version using generics and the keyof operator.
🔥 TypeScript Tip #6 🔥
Type helpers change the game when it comes to types in your codebase. They help TypeScript infer more from your code - and make your types a lot more readable.
Here, I write my own PropsFrom helper to extract props from any React component.
🔥 TypeScript Tip #8 🔥
You can use generics in React to make incredibly dynamic, flexible components. Here, I make a Table component with a generic 'items' type.