Skip to content

Conversation

bicochan
Copy link
Member

@bicochan bicochan commented Aug 3, 2024

👾 Pull Request

1️⃣ Spec

  • 현재 페이지(pathname)의 세로 스크롤 값을 로컬 스토리지에 저장하는 훅
  • 다른 페이지로 이동했다가 다시 돌아왔을 때 trigger() 함수를 실행시켜 저장된 스크롤 위치로 이동할 수 있음

2️⃣ 변경 사항

  • 없음

3️⃣ 예시 코드

function App() {
  const { moveTrigger } = useScrollY();

  useEffect(() => {
    moveTrigger();
  }, []);

  return (
    <div>
      <h1>USE-REACT-HOOKS</h1>
    </div>
  );
}

export default App;

Copy link
Member

@jeongbaebang jeongbaebang left a comment

Choose a reason for hiding this comment

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

좋은 사용자 경험을 제공할 수 있는 유용한 훅이네요. 고생하셨습니다!

Copy link
Contributor

@suhyeoonn suhyeoonn left a comment

Choose a reason for hiding this comment

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

유용한 훅이네요~! 수고하셨습니다👍

🩹 chore: window 참조 에러 방지

✅ test: 테스트 코드 수정
@bicochan bicochan force-pushed the URH-24/use-scrolly branch from 89a02d0 to 9aed81c Compare August 6, 2024 14:05
@bicochan bicochan merged commit ea977aa into master Aug 6, 2024
@bicochan bicochan deleted the URH-24/use-scrolly branch August 6, 2024 14:05
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.

3 participants