[Refactor] ScrollRestoration 사용을 위한 react router v6.4 data router 도입 #346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
React Router v6.4에서 소개된 data router 방식으로 교체하였습니다.
Ref. https://reactrouter.com/en/main/start/overview
Describe your changes
ScrollRestoration이라는 아주 좋은 기능을 사용하기 위해서는 React Router v6.4의 data router 방식으로 사용해야 했기 때문에 교체하였고, 예상보다 더 쉽게 잘 되어버려서 바로 PR을 올립니다.
ScrollRestoration은
location.key
를 키로 하기 때문에, 쿼리 스트링의 변화도 다른 페이지로 잘 인식합니다❗️Ref. https://reactrouter.com/en/main/components/scroll-restoration
Issue number and link