Skip to content

Instantly share code, notes, and snippets.

@hosembafer
Last active July 23, 2019 09:43
Show Gist options
  • Save hosembafer/45d0a16ebeebde6c618eac9bc9526fa9 to your computer and use it in GitHub Desktop.
Save hosembafer/45d0a16ebeebde6c618eac9bc9526fa9 to your computer and use it in GitHub Desktop.
import { useTodoListStore } from '../../store/TodoListStore';
const TodoList = () => {
const {
tasks,
addTask,
renameTask,
removeTask,
} = useTodoListStore();
return (
<>
<TodoListItem addTask={addTask} />
{tasks && tasks.map(task =>
<TodoListItem
key={task.id}
{...task}
renameTask={renameTask}
removeTask={removeTask}
/>
)}
</>
);
};
export default TodoList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment