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.
신경써서 구현한 부분
모달창 Modal.jsx
fixed inset-0과 flex를 사용하여 화면 전체를 덮고 중앙에 모달 박스를 정렬하여 bg-gray-400 opacity-30 으로 배경만 반투명하게하고 본문은 투명해지지 않도록 하였습니다 또한 stopPropagation으로 내부 클릭(할일이 추가되었습니다 박스 클릭)시 닫히지 않도록 하였습니다
삭제 버튼
클릭 시 onDelete 함수를 실행하는 삭제 버튼을 TodoItem.jsx 에 구현하였습니다
모달창의 열림, 닫힘 상태를 관리하는 isModalOpen 상태변수를 false로 초기화하고 상태 변경 함수 setModalOpen과 함께 선언하였습니다
새롭게 알게 된 내용
stopPropagation() 메서드
-> 위 메서드는 캡쳐 Event 링 및 버블링 단계에서 현재 이벤트가 더 전파되는 것을 방지하는 메서드이며 쉽게 말해 자식 요소의 이벤트가 부모 요소까지 전달되지 않도록 막고싶을 때 사용합니다.
질문