ts(2322) Property children does not exist on type ‘Intrinsic attributes and Props’

Task is not typed to receive children, but you are actually passing a newline text node as the task’s children.

      <Task
        key={index}
        Index={counter.toString()}
        Item={value}>{/* there is a new line text node here */}
      </Task>

You probably want to make the JSX tag self closing to ensure it has no children:

      <Task
        key={index}
        Index={counter.toString()}
        Item={value}
      />

Playground

Leave a Comment