DEV Community

Discussion on: Converting a React component to TypeScript

constantiner profile image
Konstantin Kovalev

But for this particular component even if you pass some children, they will attach nowhere. So passing them is useless. Why not restrict them then? Or I missed the point?

Thread Thread
lukeshiru profile image

For this particular component, children could go just next to the Add icon, like: <Add />{children}, or make it optional, like: {children ?? <Add />}, but yup, as it's being used right now, VFC is a better option (I mainly explained the reason why I personally default to FC).