Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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