-
Notifications
You must be signed in to change notification settings - Fork 0
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
[FE] refactor: scrollTop에서 ref로 접근하는 방식으로 변경 #639
Conversation
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.
타미 수고했어요!
자식 컴포넌트에 ref를 넘겨주는 방식이라면 forwardRef로 감싸는건 어떤가요?
@@ -1,8 +1,8 @@ | |||
import type { RefObject } from 'react'; | |||
|
|||
const useScroll = () => { |
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.
훅의 인자로 ref를 받는건 어떤가요??
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.
굿 스크롤이 훨씬 예뻐졌네여~
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.
역시 타미 짱 수고했어요!
}, 100); | ||
if (ref.current) { | ||
const timeout = setTimeout(() => { | ||
ref.current?.scrollIntoView({ behavior: 'smooth' }); |
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.
? 삭제해주세요 ㅎㅎ 제가 안 지웠음 ㅎㅎㅎ..
Issue
✨ 구현한 기능
📢 논의하고 싶은 내용
x
🎸 기타
x
⏰ 일정