Skip to content

daveyplate/use-scroll-restoration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published