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