1.2.1 • Published 9 months ago

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

Weekly downloads
67
License
MIT
Repository
github
Last release
9 months ago

react-router-scroll-to-top

npm Version npm downloads per week Minified size Open issues Open pull requests GitHub Stars CircleCI status Code scanning

ScrollToTop is a React component that scrolls to the top of a page when the current location gets changed. Since React Router doesn't provide out-of-the-box support for scroll restoration due to browsers having started handling it on their own, this package implements a component for scrolling to the top manually as it is given in React Router docs.

Usage

npm install react-router-scroll-to-top
import { ScrollToTop } from 'react-router-scroll-to-top';

const App = () => (
  <BrowserRouter>
    <ScrollToTop />
    <Routes>{/* routes */}</Routes>
  </BrowserRouter>
);

Read the documentation for more details. You can also play with a demo.

Support

If you like this package and want to support it, you can do it on Patreon

1.2.1

9 months ago

1.2.0

2 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago