DEV Community

Discussion on: Top three React & TypeScript pitfalls

Collapse
 
sgolovine profile image
Sunny Golovine

I disagree with the point you made about not using React.FC. One big reason I always use it now is that it gives you the children prop for free. So my code went from looking like this:


const MyComponent = ({ children} : {children: ReactNode}) => {...}

Enter fullscreen mode Exit fullscreen mode

to just this


const MyComponent: React.FC = ({ children }) => {....}

Enter fullscreen mode Exit fullscreen mode

Small change but accross hundreds of components it starts making a difference.