Skip to content

Conversation

@hyorish03
Copy link
Member

변경된 점

Header의 props

  • Header의 props를 useState로 관리하는 문제가 있었습니다.
  • 이렇게 관리할 경우 초기화 이후 props가 변경되더라도 리액트는 변경되었다는 것을 알 수 없기 때문에 불필요한 useState를 삭제해주었습니다.

todo 삭제 시 total과 doneCount가 변경되지 않는 이유

  • total의 경우 총 todo의 length를 반영하는 값이기 때문에 불필요한 state라서 삭제했습니다.
  • doneCount의 경우 todo 삭제시 doneCount를 세어주지 않아 나타나는 문제였기 때문에 handleDeleteTodo 함수 내에 doneCount를 새로 설정하도록 변경하였습니다.

panel의 상태관리

  • 클릭된 panel 외의 다른 panel은 닫혀야하기 때문에 panel의 부모에서 openIndex를 관리해주어, openIndex가 자기 자신이 아닐 경우 열리지 않도록 수정하였습니다.

@hyorish03 hyorish03 self-assigned this Oct 14, 2024
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