Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr kyeongseon #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Pr kyeongseon #2

wants to merge 5 commits into from

Conversation

donysony
Copy link

No description provided.

value={dateText}
name="diaryDateInput"
className="dairyDateInput"
placeholder="한 줄 일기를 작성하세요."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 input은 date가 들어간 것으로 보아 날짜를 입력하는 인풋태그인거 같은데 placeholder를 작성하신 이유가 있나요?
아래에도 diaryValueInput라는 이름의 input태그에도 placeholder가 같은 내용을 가지고 있길래 중복인가 싶어 남깁니다~ !!

<form
className="dataInputField"
onSubmit={handleSubmitDiary}>
<form className="dataInputField" onSubmit={handleSubmitDiary}>
<input
type="text"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

날짜를 입력하는 input태그 type="date"를 사용하지 않으신 이유가 따로 있는걸까요?


// 업데이트 할 때 입력 받는 부분?
const handleDiaryEditChange = (e) => {
const { name, value } = e.target;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

객체 구조 분해 할당을 적용해서 작성하신 걸까요?? 오! 이렇게도 할 수 있다는 것을 배워갑니당~!

const handleDateChange = (e) => {
setDateText(e.target.value);
setDiaryDate(e.target.value);;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 세미콜론 두개있어요~!!

};

// 기존 일기에 새로운 일기, 날짜 추가
setDiaryData((prev) => [...prev, newDiary]);
setDiaryData((prev) => [newDiary, ...prev]);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

새롭게 작성한 일기를 최상단으로 올라오도록 하기위해 이렇게 작성하신건가요?? 아이디어가 기가막히네요~!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants