Skip to content

feat: 페이지 이동 시 스크롤 상단 이동 시 스크롤 위치 복구#57

Merged
y00eunji merged 3 commits into
mainfrom
feature/scroll-restoration-2026
May 26, 2026
Merged

feat: 페이지 이동 시 스크롤 상단 이동 시 스크롤 위치 복구#57
y00eunji merged 3 commits into
mainfrom
feature/scroll-restoration-2026

Conversation

@y00eunji
Copy link
Copy Markdown
Contributor

변경 배경

페이지 이동 시 스크롤이 이전 위치에 머물러 있는 문제가 있었습니다.

변경 내용

React Router 공식 <ScrollRestoration> 컴포넌트를 적용하기 위해
BrowserRouter에서 createBrowserRouter로 라우터 방식을 마이그레이션했습니다.

<ScrollRestoration>은 Data Router API(createBrowserRouter)에서만 동작합니다.

동작 방식

  • 새 페이지로 이동 시 → 스크롤 상단으로 이동
  • 뒤로가기 / 앞으로가기 시 → 이전 스크롤 위치 복구

y00eunji added 2 commits May 15, 2026 16:56
BrowserRouter에서 createBrowserRouter로 마이그레이션하여
React Router 공식 ScrollRestoration 컴포넌트를 적용
@y00eunji y00eunji force-pushed the feature/scroll-restoration-2026 branch from 5149be3 to cc201eb Compare May 15, 2026 07:57
…ation-2026

충돌 해결:
- App.tsx: main의 올바른 import 경로(@frontend/common/hooks 등) + ScrollRestoration/Outlet 유지
- main.tsx: main의 named import/컴포넌트 참조 방식 + RouterProvider 유지 (ScrollRestoration은 data router 필요)
@y00eunji y00eunji marked this pull request as ready for review May 26, 2026 00:08
@y00eunji y00eunji merged commit d36dc28 into main May 26, 2026
@y00eunji y00eunji deleted the feature/scroll-restoration-2026 branch May 26, 2026 00:46
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