File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ integrate into any view layer that uses `history` (cycle.js, etc.).
74
74
75
75
``` js
76
76
import createBrowserHistory from ' history/lib/createBrowserHistory'
77
+ import useHistoryRestoreScroll from ' react-router-restore-scroll/lib/useHistoryRestoreScroll'
77
78
78
79
const history = useHistoryRestoreScroll (createBrowserHistory)()
79
80
@@ -93,6 +94,10 @@ history.restoreScroll.restoreWindow()
93
94
You can look at ` modules/RestoreWindowScroll.js ` and ` modules/RestoreScroll.js `
94
95
to see at which points in a React app these methods are all called.
95
96
97
+ We'll pull ` useHistoryRestoreScroll ` out into it's own package on npm
98
+ eventually so that this use-case isn't required to bring in stuff that
99
+ depends on React and React Router.
100
+
96
101
## Difference from [ taion/scroll-behavior] ( https://github.com/taion/scroll-behavior )
97
102
98
103
- It ties into the router middleware to decide when to restore scroll
You can’t perform that action at this time.
0 commit comments