Feat: stock 관련 API (리스트, 매도/매수, 상세조회) 연동 및 페이지네이션 최적화#18
Open
Feat: stock 관련 API (리스트, 매도/매수, 상세조회) 연동 및 페이지네이션 최적화#18
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
📌 Related Issues
📄 Tasks
⭐ PR Point
1. 변경 사항
종목 리스트 렌더링 최적화
클라이언트 사이드 페이지네이션 구현
검색어 변경 시 페이지를 1로 초기화
2. 문제 -> 해결
[기존 문제점]
검색어 입력 시 매 렌더마다 전체 리스트 filter 연산 수행
부모 컴포넌트 리렌더 시 자식(ListStock) 전부 재렌더링
데이터가 증가할 경우 성능 저하 가능성 존재
검색 후 페이지가 유지되어 빈 화면이 나타나는 UX 문제
[개선 방식]
1️⃣ 필터링 최적화
검색어 또는 데이터 변경 시에만 재계산
불필요한 연산 제거
2️⃣ 페이지네이션 적용
한 번에 렌더되는 컴포넌트 개수 제한
렌더링 비용 감소
3️⃣ React.memo 적용
props 변경이 없는 경우 자식 컴포넌트 리렌더 방지
리스트 렌더링 비용 절감