React로 Todo List 만들기 (추가, 수정, 삭제 기능 포함) 📑
import { useState } from "react"; function App() { const [todo, setTodo] = useState(""); const [todos, setTodos] = useState([]); const [editingTodoId, setEditingTodoId] = useState(null); const [editingTodoContent, setEditingTodoContent] = useState(""); const onChange = (event) => setTodo(event.target.value); //추가 const onSubmit = (event) => { event.preventDefault(); if (todo.trim() === "") { ret..
React
2023. 5. 7. 21:32