-
Notifications
You must be signed in to change notification settings - Fork 1
✨[Feat] 모임 찾기 검색 debounce 적용 #322
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
The head ref may contain hidden characters: "320-feature-\uBAA8\uC784-\uCC3E\uAE30-\uAC80\uC0C9-debounce-\uC801\uC6A9"
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
cloud0406
left a comment
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.
지금 내부에 메모리 누수 방지용 코드가 따로 없는 것 같아서 이 부분도 추가하면 좋을 것 같습니다!
수고하셨습니다~.~
| function SearchInput({ value, onChange }: SearchInputProps) { | ||
| const [inputValue, setInputValue] = useState(value); | ||
|
|
||
| const debouncedOnChange = 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.
p4: 여기 혹시 useMemo를 사용하신 이유가 있을까요? 이 부분은 useCallback이 어울리지 않을까 해서요!
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.
메모리 누수 방지용 코드에 대해서는 알아봐야 할 것 같아요!
useCallback 말고 useMemo를 사용한 이유는, 처음에는 useCallback으로 햇었는데 lint 에러가 발생하더라구요.
밑에 블로그 보고 해결했습니다.
내용은 "useCallback은 인라인 함수를 기대합니다. debounce나 throttle이 반환하는 함수를 전달하는 것은 적절하지 않습니다. 왜냐하면 ESLint 규칙이 어떤 의존성을 포함해야 하는지 정확히 파악할 수 없기 때문입니다. useMemo를 사용해서 해결해라"
wynter24
left a comment
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.
수고하셨습니다!
#️⃣연관된 이슈
📝작업 내용
모임 검색 부분에 debounce 적용했습니다