Skip to content

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

@johnsonsu

Description

@johnsonsu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions