Open
Conversation
donysony
commented
Jul 11, 2023
| value={dateText} | ||
| name="diaryDateInput" | ||
| className="dairyDateInput" | ||
| placeholder="한 줄 일기를 작성하세요." |
Author
There was a problem hiding this comment.
이 input은 date가 들어간 것으로 보아 날짜를 입력하는 인풋태그인거 같은데 placeholder를 작성하신 이유가 있나요?
아래에도 diaryValueInput라는 이름의 input태그에도 placeholder가 같은 내용을 가지고 있길래 중복인가 싶어 남깁니다~ !!
| onSubmit={handleSubmitDiary}> | ||
| <form className="dataInputField" onSubmit={handleSubmitDiary}> | ||
| <input | ||
| type="text" |
Author
There was a problem hiding this comment.
날짜를 입력하는 input태그 type="date"를 사용하지 않으신 이유가 따로 있는걸까요?
|
|
||
| // 업데이트 할 때 입력 받는 부분? | ||
| const handleDiaryEditChange = (e) => { | ||
| const { name, value } = e.target; |
Author
There was a problem hiding this comment.
객체 구조 분해 할당을 적용해서 작성하신 걸까요?? 오! 이렇게도 할 수 있다는 것을 배워갑니당~!
|
|
||
| const handleDateChange = (e) => { | ||
| setDateText(e.target.value); | ||
| setDiaryDate(e.target.value);; |
|
|
||
| // 기존 일기에 새로운 일기, 날짜 추가 | ||
| setDiaryData((prev) => [...prev, newDiary]); | ||
| setDiaryData((prev) => [newDiary, ...prev]); |
Author
There was a problem hiding this comment.
새롭게 작성한 일기를 최상단으로 올라오도록 하기위해 이렇게 작성하신건가요?? 아이디어가 기가막히네요~!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.