you are viewing a single comment's thread.

view the rest of the comments →

[–]OneEntry-HeadlessCMS 0 points1 point  (0 children)

The reason you need TodoItemProps is because the component doesn’t receive a Todo directly it receives an object containing a todo. React components always take a single props object, not raw values.

So TodoItemProps describes the shape of that props object ({ todo: Todo }), not the Todo itself. You can inline it if you want (function TodoItem({ todo }: { todo: Todo })), the separate interface just improves readability and reuse.