Merged
Conversation
Eunjin03
approved these changes
Apr 14, 2026
Contributor
Eunjin03
left a comment
There was a problem hiding this comment.
안녕하세요 오리! 4주차도 고생많으셨습니다.
컴포넌트화를 많이 잔행하셨네요 ㅎㅎ 이런 디테일들이 모여 리팩토링하기 쉬운 프로그램을 만드는 것 같습니다.
5주차도 화이팅입니다!
Contributor
There was a problem hiding this comment.
인스턴스 따로 분리하여 관리하는 거 좋습니다!!
| const paramsRef = useRef(params); | ||
| paramsRef.current = params; | ||
|
|
||
| const fetchData = useCallback(async () => { |
| } finally { | ||
| setLoading(false); | ||
| } | ||
| }, [url, enabled]); |
Contributor
There was a problem hiding this comment.
현재는 params를 ref로 보관하고 fetchData 의존성에서 제외하고 있어서, params만 변경되는 경우 자동 재요청이 발생하지 않을 수 있습니다.
불필요한 재호출을 줄이려는 의도는 이해되지만, 현재 구조에서는 필요한 변경까지 놓칠 수 있어 params를 의존성에 반영하는 방식으로 가져가는 것이 더 안전해 보입니다!
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.
No description provided.