DEV Community

Discussion on: React TS: Don't repeat the type when you pass functions as props, use their types.

Collapse
 
bobbycrooz profile image
bobbycrooz

But the interface resides inside the component to be used,
How does react knows about this before hand.

Collapse
 
lico profile image
SeongKuk Han

If the component doesn't export the interface, you can use ComponentProps.