1.7.3 • Published 1 year ago

scroll-to-top-react-router v1.7.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Scroll to Top on Navigate for React Router

Creates automatic scroll-to-top behaviour when the route changes. The package also preserves previous pages' scroll position upon navigating back with the Back button.

Works with the latest version of React Router

Install

npm install scroll-to-top-react-router

Import

import ScrollToTop from 'scroll-to-top-react-router'

Usage

Use inside the Router component, for example as below in App.js:

<Router>
  <ScrollToTop />
  <Routes>
    <Route path="/" exact component={Home} />
    <Route path="/about" exact component={About} />
  </Routes>
</Router>
1.7.3

1 year ago

1.7.2

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago