[Question] Why use Interfaces instead of Types
tian-yi opened this issue · 1 comments
tian-yi commented
From Typescript cheatsheet,
consider using type for your React Component Props and State, because it is more constrained.
So I just wonder why in the example, most the places using Interfaces. I am not saying it's right or wrong, just want know the thinking behind it so I can apply the same to my own code base.
Thanks!
P.S. The documentation is super helpful and easy to follow.
markerikson commented
I hadn't seen that particular line. The advice I've seen is that it's basically 50/50 either way, and I've just defaulted to writing interfaces as I learned.
And thanks, glad it's been helpful!