import { useState } from "react"; import moment from "moment"; import styles from "./modal.module.scss"; const TodoModal = () => { const [todo, setTodo] = useState({ todoTitle: "", todoDate: moment().format("YYYY-MM-DD") }) const handleChange = (e) => { const { name, value } = e.target setTodo({ ...todo, [name]: value }) } const handleClick = () => { setTodo({ todoTitle: "", todoDate: moment().format("YYYY-MM-DD") }) } return (
) } export default TodoModal;