https://github.com/hanford/scrolltop-on-mount
react HOC that resets window scrollTop on mount
https://github.com/hanford/scrolltop-on-mount
Last synced: 22 days ago
JSON representation
react HOC that resets window scrollTop on mount
- Host: GitHub
- URL: https://github.com/hanford/scrolltop-on-mount
- Owner: hanford
- Created: 2018-03-20T04:58:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-20T04:59:47.000Z (about 7 years ago)
- Last Synced: 2025-03-22T15:50:04.491Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# scrolltop-on-mount
[![Travis][build-badge]][build]
[![npm package][npm-badge]][npm]
[![Coveralls][coveralls-badge]][coveralls]Set react component scroll top on mount to top of viewport, mainly useful for wrapping different pages
[build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square
[build]: https://travis-ci.org/user/repo[npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square
[npm]: https://www.npmjs.org/package/npm-package[coveralls-badge]: https://img.shields.io/coveralls/user/repo/master.png?style=flat-square
[coveralls]: https://coveralls.io/github/user/repo```js
import withScrollTopHoc from 'scrolltop-on-mount'class RandomComponent {
...
}export default withScrollTopHoc(RandomComponent)
```