-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: 소식 페이지 헤더중 팔로잉 목록 이동 버튼을 위한 API 추가 #278
Conversation
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.
👍
const hasFollowings = followingCount > 0; | ||
const indexOffset = MAX_NUMBER_OF_PROFILES - followings.length; | ||
let nodeList: Array<ReactNode> = []; | ||
|
||
if (hasFollowings) { | ||
nodeList = followings.map(({ memberId, profileUrl }, index) => ( | ||
nodeList = followings.map(({ memberId, profileImageUrl }, index) => ( |
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.
followings.map으로도 충분히 반복문을 돌 수 있을 것 같은데 nodeList를 let으로 선언해서 사용하시는 이유가 있을까요?
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.
엇 단순히 followings 길이가 1 이상일 경우, map을 이용해 요소들의 배열을 만들어 nodeList에 넣어줘야겠다는 생각으로 작성했던 것 같습니다!
const nodeList = [...followings.map(...)];
혹시 const 선언 이후 위와 같은 방식을 말씀하시려던 걸까요?!
🤔 어떤 문제가 발생했나요?
🎉 어떻게 해결했나요?
📷 이미지 첨부 (Option)