0

I have this simple component

export interface TagProps {
  onClick: () => void
  // children: React.ReactNode
}

const TagComponent: React.FC<TagProps> = ({ children }) => {
  return <Wrap>{children}</Wrap>
}

I got Property 'children' does not exist on type 'TagProps'

unless I remove the comment at // children: React.ReactNode. As I remember I don't have to give children a type if I use React.FC.

Tina Glenn
  • 85
  • 6

0 Answers0