-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2팀 노정우] [Chapter 1-2] 프레임워크 없이 SPA 만들기 Part 2 #6
base: main
Are you sure you want to change the base?
Conversation
- currentUser 상태를 한 번에 가져오도록 수정 - handleLike 함수에서 id 파라미터 제거 (이미 props로 받고 있으므로 클로저를 통해 접근 가능) - onClick 이벤트에서 함수 호출 방식 수정 (() => handleLike(id) -> handleLike)
AI에 도움을 받았다고 하셨지만 코드 작성 과정에 고민을 많이 하셨던 흔적이 보인 것 같습니다! (저도 리팩토링에 신경을 써야 하는데 말이죠) type, props, children에서 props와 children의 역할이 비슷하면서도 조금 다른 걸로 이해하고 있어요. 속성과 자식 노드를 포함하는 것에 차이가 있는 것처럼이요(틀릴 수 있어서 조심..) 코드를 단순화할 수 있는 측면에서는 포함시키는 게 좋다고 저도 생각하고 있습니다. 혹시 멘토님 리뷰가 있었나요? 같이 고민해보면 좋을 것 같습니다 |
const { loggedIn, posts, currentUser } = globalStore.getState(); | ||
const activationLike = | ||
currentUser && likeUsers.includes(currentUser.username); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activationLike를 Post 내부에서 선언해주셨네요 👍
관심사 분리의 목적이었을까요? 의견이 궁금합니다 !
} else if (key === "htmlFor") { | ||
$el.setAttribute("for", value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디테일이네요.. htmlFor일 경우 for로 대체해주어야 하는군요 !
궁금해서 블로그도 찾아봤네요 :) 👍
https://despiteallthat.tistory.com/179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오.. 감사합니다
elementHandlers.forEach((handler) => { | ||
handler.call(target, event); | ||
}); | ||
if (!event.bubbles) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오.. bubbles 프로퍼티를 사용하면 이렇게 버블링하지 않을 때 처리를 할 수 있군요!...👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 몰랐습니다ㅎㅎ 감사합니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 이번주 과제를 제대로 못했더니, 내용적으로 리뷰를 못했습니다..!
다음에 과제 복습하고 다시 리뷰하러 올게요! 그래도 전체적으로 주석이 잘 달려 있어 잘 읽혔어요!
- if문 사용하실 때 inline하게 쓰시는 곳도 있고, bracket 사용하시는 곳도 있는 것 같아요~ 하나로 통일되면 좋을 것 같습니다!
- TestPage가 있는데 혹시 어떤 어떻게 사용하는 페이지인가요? 과제 범위는 아니었던 것 같아서 의도가 있을 것 같아 실행시켜 봤는데 어떻게 사용하는 페이지인지 잘 모르겠어서 궁금해서 여쭤봅니당 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
한 주도 고생하셨습니다ㅎㅎ
} else if (key === "htmlFor") { | ||
$el.setAttribute("for", value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오.. 감사합니다
elementHandlers.forEach((handler) => { | ||
handler.call(target, event); | ||
}); | ||
if (!event.bubbles) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 몰랐습니다ㅎㅎ 감사합니다
과제 체크포인트
기본과제
가상돔을 기반으로 렌더링하기
이벤트 위임
심화과제
1) Diff 알고리즘 구현
2) 포스트 추가/좋아요 기능 구현
과제 셀프회고
기술적 성장
코드 품질
학습 효과 분석
과제 피드백
이벤트 버블링 활용해 보세요
이런 언급이 있다면 사용하겠지만 그렇지 않으면 이벤트 버블링을 스스로 생각해내지는 못할 것 같습니다.리뷰 받고 싶은 내용
위와 같은 이유로 내부에 있던 null & undefined 체크 코드를 지웠는데 타입에러가 납니다. 왜 그런걸까요?
1️⃣ type, props, children을 각각 따로 리턴
2️⃣ props에 children을 포함시켜서 리턴
types, props, children을 각각 따로 관리하는 게 좋을것 같아서 개별적으로 return 해줬습니다.
이후에 리팩토링 단계에서 생각해보니 normalizeVNode에서 children배열 처리를 너무 복잡하게 하고 있는 것 같아, 애초에 children을 props에 포함시켜도 좋을 것 같다는 생각을 했습니다. 어떤게 더 나은 방법일까요?