Skip to content

Commit 7f0806a

Browse files
committed
Initial commit
1 parent e895181 commit 7f0806a

File tree

6 files changed

+528
-26
lines changed

6 files changed

+528
-26
lines changed

README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
# my-test-package
1+
# NextJS Scroll Restoration
2+
3+
This package enables custom Scroll Restoration for NextJS Pages Router.
4+
You may supply a delay if you need to refetch data that isn't immediate,
5+
and you may specify a selector to use an element instead of the window for restoration.
6+
7+
## Installation
8+
9+
```
10+
npm install @daveyplate/use-scroll-restoration
11+
```
12+
13+
## Usage
14+
15+
Simply call useScrollRestoration hook in a custom _app.js, parameters are all optional.
16+
17+
```
18+
export function useScrollRestoration({ router = null, enabled = true, selector = null, delay = null } = {})
19+
```

0 commit comments

Comments
 (0)