Skip to content

A HOC that will auto scroll to the bottom when a property changes

License

Notifications You must be signed in to change notification settings

cesarandreu/react-auto-scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-auto-scroll

A HOC that will auto-scroll to the bottom when a property changes.

It'll track a property and scroll to the bottom whenever it changes. If the user has scrolled up, it preserves the user's scroll position when the property changes.

Installation

$ npm i react-auto-scroll

Example

var React = require('react')
var AutoScroll = require('react-auto-scroll')
var Component = AutoScroll({
  property: 'propertyName'
})(React.createClass(/* ... */))

API

  • AutoScroll(options)(Component)

  • options.property (string) Property to track for scrolling

License

MIT

About

A HOC that will auto scroll to the bottom when a property changes

Resources

License

Stars

Watchers

Forks

Packages

No packages published