Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
johnsonsu opened this issue May 24, 2023 · 0 comments · May be fixed by #82
Open

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

johnsonsu opened this issue May 24, 2023 · 0 comments · May be fixed by #82

Comments

@johnsonsu
Copy link

johnsonsu commented May 24, 2023

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 johnsonsu changed the title onSrolll null is not an object (evaluating 'P.current.classList') onSrolll: null is not an object (evaluating 'P.current.classList') May 24, 2023
@johnsonsu johnsonsu linked a pull request May 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant