react-simple-pull-to-refresh icon indicating copy to clipboard operation
react-simple-pull-to-refresh copied to clipboard

onSrolll: null is not an object (evaluating 'P.current.classList')

Open johnsonsu opened this issue 2 years ago • 0 comments

The following line is throwing an error due to containerRef.current being null.

react-simple-pull-to-refresh/build/index.esm.js in onScroll at line 258:26

/**
 * Check if user breached fetchMoreThreshold
 */
    if (canFetchMore && getScrollToBottomValue() < fetchMoreThreshold && onFetchMore) {
            fetchMoreTresholdBreached = true;
            containerRef.current.classList.add('ptr--fetch-more-treshold-breached'); <---- This line is throwing the error
            onFetchMore().then(initContainer).catch(initContainer);
        }
    };

This can be triggered by the component getting unmounted during a scroll event.

johnsonsu avatar May 24 '23 17:05 johnsonsu