[3주차] 장승윤/[feat] 주요 기능 추가#31
Open
muang4089 wants to merge 1 commit intoLeets-Official:장승윤/mainfrom
Hidden character warning
The head ref may contain hidden characters: "\uc7a5\uc2b9\uc724/3\uc8fc\ucc28"
Open
Conversation
j2nnif2r
reviewed
Apr 8, 2026
| const keyCount = useRef(3) | ||
| const [completedCount, setCompletedCount] = useState(0) | ||
| const nameText = useRef() | ||
| const [editingId, setEditingId] = useState(0) |
There was a problem hiding this comment.
editingId의 초기값이 현재 0으로 설정되어 있는데 편집 중인 항목이 없다는 의미라면 null을 사용하는 것이 더 적절할것같습니다. 0은 실제로 존재할 수 있는 값으로 오해될 여지가 있지만 null은 “선택된 항목이 없음”을 명확하게 표현합니다. 또한 코드 내부에서도 setEditingId(null)을 사용하고 있어 초기값을 null로 통일하면 상태의 의미를 더 일관되게 유지할 수 있습니다.
sd091415
reviewed
Apr 8, 2026
Comment on lines
+32
to
+34
| nameText.current.value = "" | ||
| keyCount.current++ | ||
| setTasks(prev => [...prev, {id: keyCount.current, isCompleted: false, taskName: newNameText}]) |
There was a problem hiding this comment.
이전의 코드는 한 줄에 많은 내용이 담겨 더 고민이 필요했다면 지금은 줄마다 다른 내용이 되어 더 직관적이라 보기도 좋고 다른 사람이 이해하기에도 더 쉬운 코드가 된 거 같습니다.
wo-gml
reviewed
Apr 8, 2026
| const countCompleted = (id, isChecked) => { | ||
| const copiedTasks = tasks.map(task => | ||
| task.id === id ? { ...task, isCompleted: isChecked } : task | ||
| ) |
Contributor
There was a problem hiding this comment.
addTask와 deleteTask에서 prev을 사용하여 상태를 업데이트 한 부분이 좋았습니다. countCompleted도 다른 것과 마찬가지로 코드의 일관성을 위해 prev을 사용하는 것을 고려하면 좋을 것 같습니다!
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.
1. 과제 요구사항 중 구현한 내용
2. 핵심 변경 사항
3. 실행 및 검증 결과
npm run dev로 정상 실행됨. ESLint 오류 없음, 빌드 성공 (npm run build).5. 추가 사항
closed #30제출 체크리스트
{이름}/main브랜치다{이름}/{숫자}주차브랜치다Reviewer가 참고할 내용