6주차 미션 1 완료#62
Open
2yunkind wants to merge 35 commits into
Open
Conversation
Week2/yunsl m1
Week3/yunsl m2
week3 Single Page Application 만들어보기
4주차 미션 1,2 완료
yewon20804
reviewed
May 12, 2026
Collaborator
yewon20804
left a comment
There was a problem hiding this comment.
6주차 첫번째 미션 확인했습니다 ! useQuery를 사용해서 LP 목록 화면을 진행해주셨습니다 🙂 PR 업로드 해주실 때 화면 녹화도 같이 포함해주면 코드 리뷰할 때 더 도움이 될 것 같습니다 ㅎㅎ 아래 코멘트도 확인해주세요 !
1. lp.ts — API 경로 오타
axiosInstance.get()에 전달하는 URL이 슬래시(/) 대신 점(.)으로 작성되어 있습니다. 이 상태로는 API 요청이 전혀 동작하지 않습니다 !
// 현재 (week6/mission1/src/apis/lp.ts)
const { data } = await axiosInstance.get('v1.lps', { ... });
// 수정
const { data } = await axiosInstance.get('/v1/lps', { ... });
2. HomePage.tsx — isError 조건 반전
에러 조건이 반대로 작성되어 있습니다. 현재 코드에서는 에러가 없을 때 "Error" 화면이 렌더링되고, 실제 에러가 발생하면 LP 목록이 렌더링되는 반전이 일어납니다 !
// 현재 (week6/mission1/src/pages/HomePage.tsx)
if(!isError){
return <div className={"mt-20"}>Error</div> // 에러가 없을 때 Error 화면이 뜸!
}
// 수정
if(isError){
return <div className={"mt-20"}>Error</div>
}
3. HomePage.tsx — list 렌더링 시 key prop 누락
map()으로 LP 목록을 렌더링할 때 key prop이 없습니다. React 경고가 발생하고 리렌더링 최적화가 되지 않습니다 !
// 현재 (week6/mission1/src/pages/HomePage.tsx)
{data?.map((lp) => <h1>{lp.title}</h1>)}
// 수정
{data?.map((lp) => <h1 key={lp.id}>{lp.title}</h1>)}
4. lp.ts — authorId 오타
types/lp.ts의 LP 타입 정의에서 authorId가 authorld로 잘못 작성되어 있습니다. 소문자 l(엘)이 대문자 I(아이)처럼 보이는 오타입니다 !
// 현재 (week6/mission1/src/types/lp.ts)
authorld: number;
// 수정
authorId: number;
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.
📚 주차 / 미션
📌 작업 내용
---LP 페이지(목록/상세)를 그대로 활용하되, 커스텀 훅(Custom Hook)으로 데이터 패칭, 로딩, 에러 처리를 만든 과정을 useQuery로 변경
✨ 상세 작업 내용
📸 스크린샷
❓ 리뷰어가 알아야 할 사항 / 질문
✅ 체크리스트