lets say I am rendering data dynamically
In the end data will exceed the length of container which will make the scroll bar to be activated.
I am looking for a way to make the element scroll down as a default
I've tried to use "onUpdate" property but without success
Thanks,
Asaf
<Scrollbars style={{ height: 450, width: '100%' }} ref="scrollbars"> ... </Scrollbars>
manage to do so by adding a ref.. and then the ref object add all the methods...
and then did this ->
componentDidUpdate() {
const { scrollbars } = this.refs
scrollbars.scrollTop(scrollbars.getScrollHeight())
}
Most helpful comment
<Scrollbars style={{ height: 450, width: '100%' }} ref="scrollbars"> ... </Scrollbars>manage to do so by adding a ref.. and then the ref object add all the methods...
and then did this ->
componentDidUpdate() { const { scrollbars } = this.refs scrollbars.scrollTop(scrollbars.getScrollHeight()) }