Open
Conversation
jjuchan
reviewed
Jul 11, 2025
| @@ -0,0 +1,59 @@ | |||
| "use client"; | |||
| import { FormEvent, useState } from "react"; | |||
|
|
|||
There was a problem hiding this comment.
FormEvent 타입을 사용해서 onSubmit 이벤트 객체의 타입을 명확히 지정한 점이 좋은 것 같습니다..! 처음 봤어요 사실
kku1403
reviewed
Jul 11, 2025
| function TodoList({ todos, deleteTodo, toggleTodo }: Props) { | ||
| return ( | ||
| <ul className="max-w-md mx-auto mt-6 space-y-4 bg-gray-50 rounded-lg p-4 shadow-md"> | ||
| {todos && |
There was a problem hiding this comment.
todos가 빈 배열이 아니라 아예 null이거나 undefined일 때를 처리하셨네요! 저는 아예 생각도 못했던 부분인데... 와우 👏 또 하나 배워갑니다...
| onChange={(e) => setPriority(Number(e.target.value))} | ||
| className="border border-gray-300 rounded-md px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500" | ||
| > | ||
| <option value="" disabled> |
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.
TODO APP 구현
next.js, react를 이용하여 만든 우선순위 기반 Todolist 어플리케이션입니다.
기능 요약
디렉터리 구조
컴포넌트 설명
TodoItem: 개별 할 일 항목을 렌더링하여 체크, 삭제, 우선순위 스타일링
TodoList: 전체 할 일 리스트 순회
TodoWriteForm: 할 일 & 우선순위 작성 후 등록하는 폼
상태 관리 흐름