[8주차/오스카] 워크북 제출합니다.#84
Open
OscarKang1 wants to merge 3 commits into
Open
Conversation
bukyung03
reviewed
May 22, 2026
| const lps = data?.pages.flatMap((page) => page.data) ?? []; | ||
|
|
||
| // 스크롤 이벤트 등록 — raw 이벤트는 매우 빠르게 발생하므로 state만 업데이트 | ||
| useEffect(() => { |
There was a problem hiding this comment.
현재 구조는 스크롤이 조금만 움직여도 setScrollY가 실행되어 HomePage 컴포넌트 전체가 여러 번 리렌더링되는 현상이 발생할 것 같습니다
또한, 스크롤할 때마다 실시간으로 상태가 바뀌다 보니 useThrottle은 컴포넌트가 다 재생성된 후에 뒤늦게 작동하여 최적화 역할을 못할 것 같습니다
스크롤 이벤트 핸들러 함수 자체를 Throttling으로 감싸서, setScrollY가 호출되는 빈도 자체를 일정시간에 한 번으로 제한 하는 것이 좋을 것 같습니다
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.
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트
📌 주안점