Typescript stories - Generics vs Union types
This will be a quick and more “back-to-basics” kind of article.
While doing some small refactoring, I stumbled across a situation where I had to pass an object, but the shape of the object is completely different depending on the component using that...
blog.mihaioltean.com4 min read
This article discusses handling varying object shapes in TypeScript while avoiding the use of the
anytype. It explores several approaches:The article concludes that understanding when to use each method helps achieve a balance between flexibility, reusability, and type safety.