Skip to content

[week04] 오리 4주차 미션1#78

Merged
Eunjin03 merged 1 commit intomainfrom
week04_duck_mossion1
Apr 14, 2026
Merged

[week04] 오리 4주차 미션1#78
Eunjin03 merged 1 commit intomainfrom
week04_duck_mossion1

Conversation

@kim3360
Copy link
Copy Markdown
Member

@kim3360 kim3360 commented Apr 10, 2026

No description provided.

@kim3360 kim3360 requested a review from Eunjin03 April 10, 2026 10:48
@kim3360 kim3360 self-assigned this Apr 10, 2026
Copy link
Copy Markdown
Contributor

@Eunjin03 Eunjin03 left a comment

Choose a reason for hiding this comment

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

안녕하세요 오리! 4주차도 고생많으셨습니다.

컴포넌트화를 많이 잔행하셨네요 ㅎㅎ 이런 디테일들이 모여 리팩토링하기 쉬운 프로그램을 만드는 것 같습니다.

5주차도 화이팅입니다!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

인스턴스 따로 분리하여 관리하는 거 좋습니다!!

const paramsRef = useRef(params);
paramsRef.current = params;

const fetchData = useCallback(async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

useCallback 사용하셨네요!👍

} finally {
setLoading(false);
}
}, [url, enabled]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

현재는 params를 ref로 보관하고 fetchData 의존성에서 제외하고 있어서, params만 변경되는 경우 자동 재요청이 발생하지 않을 수 있습니다.

불필요한 재호출을 줄이려는 의도는 이해되지만, 현재 구조에서는 필요한 변경까지 놓칠 수 있어 params를 의존성에 반영하는 방식으로 가져가는 것이 더 안전해 보입니다!

@Eunjin03 Eunjin03 merged commit 4424150 into main Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants