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

Uncaught TypeError: Cannot read property 'getBoundingClientRect' of null #6

Open
hazirmagron opened this issue Oct 9, 2018 · 7 comments

Comments

@hazirmagron
Copy link

Following the 'full example' I get this error once I scroll while the component where react-simple-infinite-scroll lies has been unmount.

I assume the error has to do with not removing the event listener to scroll - which should be done once the component containing the infinite scroll is unmounted. This seems to be coupled with how the sentinel object is handled, which is mentioned in the DOCS. It is unclear how it should be used, however.

This, to me, seems like a DOC issue if anything. I think this issue has been accounted for. It is just not properly communicated in the DOCS.

@pgarciacamou
Copy link
Contributor

Hi @hazirmagron

I'm guessing you downloaded the package from npm? If this is true, the problem you are talking about was fixed in #1 but was never published to npm, current version in npm is the original version v0.0.1, a lot has changed since then. Let me know if I'm correct.

Either way we have to publish a new version of this module to npm. @jaredpalmer I vote for bumping up from 0.x to 1.0.0 due to the latest updates and then publish.

@hazirmagron
Copy link
Author

Hi @pgarciacamou!

Yes, you're very much right. I did install it through npm. Makes sense how you communicated on the DOC then. Yes, update the npm version please. It is a very messy and annoying bug.

@pgarciacamou
Copy link
Contributor

pgarciacamou commented Oct 14, 2018

@hazirmagron so, I had an idea (sorry in advance 🙉)

I honestly believe that @jaredpalmer is super busy with react itself so, what I would suggest is to fork this repo and install from git. This is what you would need to do:

  1. Fork this repo
  2. Clone the fork to your file system
  3. Remove lib from .gitignore: https://github.com/jaredpalmer/react-simple-infinite-scroll/blob/master/.gitignore#L2
  4. run yarn install && npm run build
  5. commit and push to your git fork (preferably to a descriptive branch like temp-fork)
  6. install in the repo you want to use this module via:
npm install --save username/repo#branch-name

# like:
npm install --save pgarciacamou/react-simple-infinite-scroll#temp-fork

Note that I haven't tried this and this is only a temporary solution, but Jared hasn't answered my messages so that is the best I've got.

Let me know if you have any questions.

@davidsoderberg
Copy link

@pgarciacamou that worked for me, thanks 😄

@iest
Copy link

iest commented Sep 16, 2019

If anyone's interested, I published the fixed version of this package here: https://www.npmjs.com/package/react-simple-infinite-scroll-patched

@baleeds
Copy link

baleeds commented Nov 13, 2019

If anyone's interested, I published the fixed version of this package here: https://www.npmjs.com/package/react-simple-infinite-scroll-patched

@iest I tried your patch and I'm getting duplicate key issues, meaning that my queries aren't being throttled. I wasn't having this issue with v.0.0.1. Any ideas?

@baleeds
Copy link

baleeds commented Nov 14, 2019

It's because v0.0.2 includes this PR was merged in, but it's buggy.

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

No branches or pull requests

5 participants