Week6/celine m1#61
Open
yoons-art wants to merge 28 commits into
Open
Conversation
feat: 1주차 미션 완료
Week3/celine m2
Week3/celine m3
Week4/celine m2
Week4/celine m3
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
yewon20804
reviewed
May 12, 2026
Collaborator
yewon20804
left a comment
There was a problem hiding this comment.
6주차 첫번째 미션 확인했습니다 ! useQuery를 사용해서 lp 목록 / 상세 페이지를 진행해주시는게 미션이였는데요🙂 PR 업로드 해주실 때 화면 녹화도 같이 포함해주면 코드 리뷰할 때 더 도움이 될 것 같습니다 ㅎㅎ 아래 코멘트도 확인해주세요 !
1. axios.ts — React Hook을 일반 함수 안에서 호출
axiosInstance.interceptors.request.use((config) => {
const {getItem} = useLocalStorage(LOCAL_STORAGE_KEY.accessToken); // 💥
...
});
React Hook은 컴포넌트나 커스텀 Hook 내부에서만 호출할 수 있습니다 ! Axios 인터셉터는 일반 함수라서 여기서 useLocalStorage를 쓰면 에러가 발생합니다 !
2. AuthContext.tsx — alert("로그인 실패")가 try-catch 바깥에 위치
// 기존 - 중괄호 위치 오류
try {
...
alert("로그인 성공");
} catch(error) {
console.error("로그인 오류:", error);
} // ← catch 종료
alert("로그인 실패"); // 로그인 성공해도 실행됨
// ✅수정 예시
try {
const {data} = await postSignin(signinData);
if (data) {
// ...토큰 저장...
alert("로그인 성공");
}
} catch(error) {
console.error("로그인 오류:", error);
alert("로그인 실패"); // catch 안으로 이동
}
로그인 성공/실패와 관계없이 항상 "로그인 실패" 알림이 뜨게 됩니다 !
위에는 로그인 피드백이였고 밑에는 6주차 미션 부분 !
3. HomePage.tsx — map에서 key prop 누락
// key 없음 → React 경고 발생
{data?.data?.data?.map((lp) => <h1>{lp.title}</h1>)}
// 수정
{data?.data?.data?.map((lp) => <h1 key={lp.id}>{lp.title}</h1>)}
4. useGetLpList.ts — queryKey에 cursor, limit 누락
// 현재 - cursor, limit 빠져 있음
queryKey: [QUERY_KEY.lps, search, order],
queryFn: () => getLpList({ cursor, search, order, limit }),
// 수정
queryKey: [QUERY_KEY.lps, cursor, search, order, limit],
cursor나 limit이 바뀌어도 queryKey가 동일하면 캐시된 이전 데이터를 그대로 반환합니다. 커서 기반 페이지네이션 구현 시 다음 페이지 데이터를 불러오지 못하기 때문에 데이터가 적절하게 반환되고 있는지 확인 필요할 것 같아요 !!
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.
📚 주차 / 미션
📌 작업 내용
✨ 상세 작업 내용
✅ 체크리스트