DEV Community

Discussion on: Default Props in React/TypeScript

Collapse
 
chico1992 profile image
chico1992

Your welcome

The nice thing about the React.FC is that it defines the return type of your function and it add children?: React.ReactNode to your props so no need to handle that prop yourself

Thread Thread
 
bytebodger profile image
Adam Nathaniel Davis

OIC. I think I had kinda stumbled into a different way to handle that. Cuz in my (final) example, my interface is defined as:

interface Props extends PropsWithChildren<any> {...}
Enter fullscreen mode Exit fullscreen mode

But I think I like the React.FC way better.