We’ll refactor our existing code and break the pieces of the application into their own stateless functional components. We’ll use these components to build up our UI. We’ll also see how we can use ES6 destructuring syntax to accept just the keys we need from props to keep our JSX clean.
why did you use spread operator for the props that's going into <TodoItem> component? (instead of just passing it as props which you did to to the TodoList component
why did you use spread operator for the props that's going into <TodoItem> component? (instead of just passing it as props which you did to to the TodoList component
I used spread when passing the todo into the TodoItem
component as an alternative to passing each property of the todo individually. When I passed the todos into TodoList
, I was only passing a single prop, so it didn't make sense to pass down an entire object.
Hope this helps.