Open
Conversation
aeongiing
reviewed
Apr 11, 2026
bukyung03
reviewed
Apr 11, 2026
kcleverp
reviewed
Apr 11, 2026
kcleverp
reviewed
Apr 11, 2026
qkrdmsthff
approved these changes
Apr 13, 2026
Collaborator
qkrdmsthff
left a comment
There was a problem hiding this comment.
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 : '알 수 없는 오류가 발생했습니다.') | ||
| } | ||
| }) |
Collaborator
There was a problem hiding this comment.
새로운 fetchFn 이 들어올 때 이전 데이터가 그대로 남아있으면, UX 측면에서 깜빡이는 현상이 발생할 수 있습니다.
load 함수가 시작될 때, setData(null) 을 호출하여 상태를 초기화해 주면 좋을 것 같네요~
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.
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트
📌 주안점