react-scroll-to-top-route

1.0.4 • Public • Published

react-scroll-to-top-route

npm version Build Status NPM Packages NPM Dev Dependencies

A ReactJS route component that scrolls users back to the top of the page when navigating around with the react router.

Example

import ScrollToTopRoute from "react-scroll-to-top-route";
 
// Example usage
const Routes = () => 
<Switch>
    <ScrollToTopRoute
        path="/example-but-with-scrolling"
        render={() => <p>Normal route with scrolling to top when navigating.</p>}
    />
    <Route
        path="/example"
        render={() => <p>Normal route.</p>}
    />
</Switch>;

Package Sidebar

Install

npm i react-scroll-to-top-route

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

34.3 kB

Total Files

13

Last publish

Collaborators

  • devbytecom