Check for ref before access scrollTop

pull/34/head
Lim Chee Aun 2022-12-27 09:05:45 +08:00
rodzic f7489710a1
commit fb88129ae7
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -36,6 +36,7 @@ function StatusPage({ id }) {
useEffect(() => {
const onScroll = debounce(() => {
// console.log('onScroll');
if (!scrollableRef.current) return;
const { scrollTop } = scrollableRef.current;
states.scrollPositions.set(id, scrollTop);
}, 100);