An open API service indexing awesome lists of open source software.

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

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)
```