Skip to content

Commit 6e1b289

Browse files
committed
moar typing
1 parent 097f69c commit 6e1b289

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ integrate into any view layer that uses `history` (cycle.js, etc.).
7474

7575
```js
7676
import createBrowserHistory from 'history/lib/createBrowserHistory'
77+
import useHistoryRestoreScroll from 'react-router-restore-scroll/lib/useHistoryRestoreScroll'
7778

7879
const history = useHistoryRestoreScroll(createBrowserHistory)()
7980

@@ -93,6 +94,10 @@ history.restoreScroll.restoreWindow()
9394
You can look at `modules/RestoreWindowScroll.js` and `modules/RestoreScroll.js`
9495
to see at which points in a React app these methods are all called.
9596

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+
96101
## Difference from [taion/scroll-behavior](https://github.com/taion/scroll-behavior)
97102

98103
- It ties into the router middleware to decide when to restore scroll

0 commit comments

Comments
 (0)