malte-wessel / react-custom-scrollbars

React scrollbars component
http://malte-wessel.github.io/react-custom-scrollbars/
MIT License
3.2k stars 577 forks source link

using autoHide at re-rendering chat #413

Open ivanudovin-roonyx opened 2 years ago

ivanudovin-roonyx commented 2 years ago

Hey guys, nice scrollbars! I'm building chat with old messages update on scroll, so whenever I call out old messages download, my chat component does re-render and so for a few seconds scroll disappears from DOM (as I figure) and gives a console error. Nothing breaks, the app works as planned but the console log error is still there. Is there any way to add (I'm still looking for this place) a check for null or how to disable this error console?

Console error is: `index.js:18 Uncaught TypeError: Cannot read properties of null (reading 'style')

at style (index.js:18:1)

at each (index.js:25:1)

at set (index.js:42:1)

at index.js:570:1`

The first light up is some prop 'camel', no idea what is that: element.style[camel] = addPxToStyle(camel, value)