-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use react lifecycle to manage scroll
This fixes a issue where scroll restoration was not working as it was called before react renders the restored page. In this change we move the restoration to `useLayoutEffect`. In reviewing the fix, we noticed that `setActivePage` was not being dispatched in `navigateTo`, and relied on `onHistoryChange` to make the correct changes. We refactor to move the explicit nav logic from `onHistoryChange` and back to `navigateTo`.
- Loading branch information
Showing
2 changed files
with
87 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters