Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NextJS Scroll Restoration

This package enables custom Scroll Restoration for NextJS Pages Router. You may supply a delay if you need to refetch data that isn't immediate, and you may specify a selector to use an element instead of the window for restoration.

Installation

npm install @daveyplate/use-scroll-restoration

Usage

Simply call useScrollRestoration hook in a custom _app.js, parameters are all optional.

export function useScrollRestoration({ router = null, enabled = true, selector = null, delay = null } = {})

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages