import { createId } from '@paralleldrive/cuid2'; 추가
const clickAddButtonHandler = () => {
//id 랜덤값으로 자동 부여
const newList = {
id: createId(),
title,
body,
isDone: false
}
//newList 투두리스트 추가 (제목, 내용 비어있으면 alert 띄우기)
if (title.length !== 0 && body.length !== 0) {
setList([...list, newList])
setTitle("")
setBody("")
} else {
alert('빈 칸을 채워주세요')
}
}