Skip to content

[4주차/오스카] 워크북 제출합니다.#40

Open
OscarKang1 wants to merge 2 commits intoUMC-Inha:오스카/mainfrom
OscarKang1:main
Open

[4주차/오스카] 워크북 제출합니다.#40
OscarKang1 wants to merge 2 commits intoUMC-Inha:오스카/mainfrom
OscarKang1:main

Conversation

@OscarKang1
Copy link
Copy Markdown

✅ 워크북 체크리스트

  • 모든 핵심 키워드 정리를 마쳤나요?
  • 핵심 키워드에 대해 완벽히 이해하셨나요?
  • 이론 학습 이후 직접 실습을 해보는 시간을 가졌나요?
  • 미션을 수행하셨나요?
  • 미션을 기록하셨나요?

✅ 컨벤션 체크리스트

  • 디렉토리 구조 컨벤션을 잘 지켰나요?
  • pr 제목을 컨벤션에 맞게 작성하였나요?
  • pr에 해당되는 이슈를 연결하였나요?(중요)
  • 적절한 라벨을 설정하였나요?
  • 파트장에게 code review를 요청하기 위해 reviewer를 등록하였나요?
  • 닉네임/main 브랜치의 최신 상태를 반영하고 있는지 확인했나요?(매우 중요!)

📌 주안점

Comment thread mission/chapter04/ch4_m3/src/components/Navbar.tsx Outdated
Comment thread mission/chapter04/ch4_m1/src/pages/MovieDetailPage.tsx Outdated
Comment thread mission/chapter04/ch4_m3/src/api/authApi.ts Outdated
Comment thread mission/chapter04/ch4_m3/src/api/authApi.ts Outdated
Copy link
Copy Markdown
Collaborator

@qkrdmsthff qkrdmsthff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 오스카 피드백이 늦었네요 죄송해요 ~~ 시험 공부 화이팅하고 5주차때도 열심히 해봅시다

Comment on lines +13 to +35
useEffect(() => {
if (!url) return

const fullUrl = paramsString ? `${url}?${paramsString}` : url
const controller = new AbortController()

setIsLoading(true)
setError(null)

fetch(fullUrl, {
headers: { Authorization: `Bearer ${ACCESS_TOKEN}` },
signal: controller.signal,
})
.then((res) => {
if (!res.ok) throw new Error(`서버 오류가 발생했습니다. (${res.status})`)
return res.json() as Promise<T>
})
.then((json) => setData(json))
.catch((err) => {
if (err.name !== 'AbortError') {
setError(err instanceof Error ? err.message : '알 수 없는 오류가 발생했습니다.')
}
})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

새로운 fetchFn 이 들어올 때 이전 데이터가 그대로 남아있으면, UX 측면에서 깜빡이는 현상이 발생할 수 있습니다.
load 함수가 시작될 때, setData(null) 을 호출하여 상태를 초기화해 주면 좋을 것 같네요~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants