Thanks for the best component !!!
I created a chat room, for my chat I need to be scrolled always down (default),
how can I achieve this ?
Use the method scrollToBottom?
Get the instance first <Scrollbars ref={c => { this.scrollComponent = c }}> and then on every time the message is added call the function scrollToBottom, best in setTimeout(..., 0) to be sure it is called after render has completed. Or call it in componentDidUpdate and detect that number of messages have changed.
Yeah it work good!!!
thank you ...
Most helpful comment
Use the method
scrollToBottom?Get the instance first
<Scrollbars ref={c => { this.scrollComponent = c }}>and then on every time the message is added call the functionscrollToBottom, best in setTimeout(..., 0) to be sure it is called after render has completed. Or call it in componentDidUpdate and detect that number of messages have changed.