Feat: Week6/nonshaman-m1#59
Open
nonshaman wants to merge 13 commits into
Open
Conversation
Feat: Week3/nonshaman m1
feat: 3주차 미션 2 진행 (fix)
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. React Hook을 인터셉터(일반 함수) 내에서 호출
// src/apis/axios.ts
// 현재
axiosInstance.interceptors.request.use((config) => {
const { getItem } = useLocalStorage(LOCAL_STORAGE_KEY.accessToken);
const accessToekn = getItem();
// 수정 - localStorage를 직접 사용
axiosInstance.interceptors.request.use((config) => {
const accessToken = localStorage.getItem(LOCAL_STORAGE_KEY.accessToken);
React Hooks는 React 컴포넌트 또는 커스텀 훅 안에서만 호출되어야 합니다. 인터셉터는 일반 JS 함수이므로 useLocalStorage 호출 시 런타임 에러가 발생합니다 !
2. vite.config.ts에서 React 플러그인 누락
import react from '@vitejs/plugin-react' // 추가
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [
react(),
tailwindcss(),
],
})
package.json에는 @vitejs/plugin-react가 있지만 vite.config.ts에서 등록하지 않아 JSX 변환이 되지 않아 앱 자체가 동작하지 않습니다..!
3. 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.
📚 주차 / 미션
📌 작업 내용
✨ 상세 작업 내용
✅ 체크리스트