DEV Community

Discussion on: Currying React components in TypeScript

Collapse
 
lishine profile image
Pavel Ravits

I mean, You put put params in an array and so it is not clear to which param each item belong. Again, what is the benefit of this.
First thing in the article I would like to see purpose and benefit.

Thread Thread
 
captainyossarian profile image
yossarian

Please see original question on stackoverflow. Each componene receives all properties, but uses only a part from them. As for the benefits. I wanted to show how we can make basic validation of react components and their props. Also I wanted to show that sometimes it is tricky to work with FC<Props> type because of contravariance. If above examples are not useful for you, it is perfectly fine. Everybody has his own code style, guide, preferences etc...