import React, {useState} from 'react'; import Task from '../components/Task'; const TodoList = () => { const [tasks, setTasks] = useState([]); const addTask = (task) => { setTasks([...tasks, task]); }; const handleKeyDown = (e) => { if (e.key === 'Enter') { addTask(e.target.value); e.target.value = ''; } }; return (

Todo List

); }; export default TodoList;