import React from "react"; import { connect } from "react-redux"; function TaskList(props) { const handleAddTask = () => { const text = prompt("Enter a new task:"); if (text) { props.dispatch({ type: "ADD_TASK", text, id }); } }; const handleToggleTask = (id) => { props.dispatch({ type: "TOGGLE_TASK", id }); }; return (
); } function mapStateToProps(state) { return { tasks: state.tasksReducer.tasks, }; } export default connect(mapStateToProps)(TaskList);