-
Notifications
You must be signed in to change notification settings - Fork 8
[10주차/눈송이] 워크북 제출합니다. #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 눈송이/main
Are you sure you want to change the base?
The head ref may contain hidden characters: "\uB208\uC1A1\uC774/main"
Conversation
| const [selected, setSelected] = useState<Movie | null>(null); | ||
|
|
||
| // ✅ params 객체를 useMemo로 고정 (불필요 렌더/호출 방지) | ||
| const params = useMemo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
검색 파라미터 객체를 useMemo로 고정하여, 렌더링마다 새로운 객체가 생성되는 문제를 방지해 params를 의존성으로 사용하는 useCallback(handleSubmit)이 불필요하게 재생성되지 않아, 훅 간의 의존 관계가 안정적으로 유지된 점이 좋은 것 같습니다.
|
키워드 파일이 안 올라온것 같아요! 내용이 비어 있다고 뜹니다 |
|
|
||
| const handleClickMovie = useCallback((movie: Movie) => { | ||
| setSelected(movie); | ||
| }, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleClickMovie는 다수의 MovieCard에 전달되는 콜백이므로 useCallback으로 참조 안정성을 확보하고
의존성 배열을 정확히 관리해 불필요한 리렌더링과 stale closure 문제를 방지한 점이 좋네요!
|
눈송이 마지막까지 열심히 미션 수행해주셔서 감사하고 데모데이까지 파이팅입니다! |
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트
📌 주안점