TypeScript Types Vs. Interfaces

preview_player
Показать описание
Let's talk about Type Aliases and Interfaces in TypeScript! In today's video, we will go over their differences and use cases.
Рекомендации по теме
Комментарии
Автор

Thank you. This helped me gain a better understanding of the differences (capabilities and limitations) between types and interfaces. The code examples helped a lot!

francoortegadev
Автор

Thanks! I can never decide between the two when declaring my props in a React component!

nelsonfleig
Автор

For me is like types are just better, they are more flexible. yes, Interface has Declaration merging but is something that can be dangerous, even if that is what you want (merging), I think that the approach of type ( give you a duplication error ) is best, because it gives you the opportunity of checking if this is something that you actually wanna do ( merging), and if so, the use the "&" to combine the types a get a new type with all the property of the ones you want. This is giving me a headache. Great video

maironl
Автор

Thank you for the video, it was really helpful!

stasoline