6주차 미션 2 완료#63
Open
2yunkind wants to merge 36 commits into
Open
Conversation
Week2/yunsl m1
Week3/yunsl m2
week3 Single Page Application 만들어보기
4주차 미션 1,2 완료
yewon20804
reviewed
May 14, 2026
Collaborator
yewon20804
left a comment
There was a problem hiding this comment.
6주차 미션 2도 수고하셨습니다 ! useInfiniteQuery 무한스크롤 + 스켈레톤 UI 구현을 구현해보는게 미션 내용이였는데요 ! 미션 1에 남겨드린 코멘트랑 종합해서 정리해드리겠습니다 ! 여기서 한번에 확인하시고 수정해보시면 좋을 것 같아요 👍
1. API 엔드포인트 오타
// 현재 (점(.) 사용 — 잘못된 URL)
const { data } = await axiosInstance.get('v1.lps', { params: paginationDto });
// 수정
const { data } = await axiosInstance.get('/v1/lps', { params: paginationDto });
.으로 구분된 'v1.lps'는 존재하지 않는 경로입니다! 이렇게 되면 LP 데이터 조회가 실패합니다.
2. useInfiniteQuery 응답 데이터 구조 접근 오류 - useGetInfiniteLpList.ts
// 현재
getNextPageParam: (lastPage) => {
return lastPage.data.hasNext ? lastPage.data.nextCursor : undefined;
}
// 수정
getNextPageParam: (lastPage) => {
return lastPage.hasNext ? lastPage.nextCursor : undefined;
}
ResponseLpListDto 타입을 보면 hasNext와 nextCursor는 data 안이 아니라 최상위 레벨에 있어서 바로 접근해주시면 됩니다 !
3. axios.ts 인터셉터에서 useLocalStorage Hook 잘못 사용
// 현재
if (originalRequest.url?.includes("/v1/auth/refresh")) {
const { removeItem: removeAccessToken } = useLocalStorage(LOCAL_STORAGE_KEY.accessToken); // ❌
...
}
// 수정 — localStorage를 직접 사용
if (originalRequest.url?.includes("/v1/auth/refresh")) {
localStorage.removeItem(LOCAL_STORAGE_KEY.accessToken);
localStorage.removeItem(LOCAL_STORAGE_KEY.refreshToken);
window.location.href = "/login";
return Promise.reject(error);
}
React Hook은 컴포넌트나 커스텀 훅 최상위에서만 호출 가능합니다! 인터셉터 내부에서 호출하면 규칙 위반으로 런타임 에러가 발생합니다.
4. HomePage.tsx — 에러 조건 반전
// 현재 — isError가 false일 때 에러 표시
if (!isError) {
return <div>Error</div>
}
// 수정
if (isError) {
return <div className={"mt-20"}>Error</div>
}
5. 오타 및 테일윈드 오타
types/lp.ts — 오타 authorld
// 현재
authorld: number; // l이 섞인 오타
// 수정
authorId: number;
Navbar.tsx — 검색 링크 className 오타
// 현재 — = 대신 =이 들어감
className="text=gray-700 dark:text-gray-300 hover:text-blue-500"
// 수정
className="text-gray-700 dark:text-gray-300 hover:text-blue-500"
LpCardSkeleton.tsx — Tailwind 클래스 오타
// shadow-lo → 존재하지 않는 클래스
<div className="relative rounded-lg overflow-hidden shadow-lo animate-pulse">
// 수정
<div className="relative rounded-lg overflow-hidden shadow-lg animate-pulse">
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.
📚 주차 / 미션
📌 작업 내용
무한스크롤 부분 useInfiniteQuery로 무한스크롤 구현해보기 + 스켈레톤 UI
✨ 상세 작업 내용
📸 스크린샷
❓ 리뷰어가 알아야 할 사항 / 질문
✅ 체크리스트