React - To-do App in React
Let’s write a simple To-Do app with React-js. We’ll create components for adding, displaying, and deleting tasks. Project Structure: your-todo-app/ ├── node_modules/ ├── public/ │ ├── index.html │ └── ... ├── src/ │ ├── components/ │ │ ├── TodoList.js │ │ ├── TodoItem.js │ │ └── TodoForm.js │ ├── App.js │ ├── index.js │ └── ... ├── package.json └── ... Steps: Create TodoItem Component: // src/components/TodoItem.js import React from 'react'; function TodoItem({ task, onDelete }) { return ( <div> <span>{task}</span> <button onClick={onDelete}>Delete</button> </div> ); } export default TodoItem; Create TodoList Component:...