react-virtual-container icon indicating copy to clipboard operation
react-virtual-container copied to clipboard

infinite loops with inAndOut enabled

Open oyeanuj opened this issue 7 years ago • 4 comments

Hi @ctrlplusb! Excited about this component - thanks for sharing!

I am using it on a feed where I fetch content as a user scrolls. I noticed that if you have inAndOut prop enabled, it leads to an infinite loop with the components re-rendering (even without scrolling up). So, it freezes or crashes the browser in just a few seconds :/

Any ideas on what might be going on?

oyeanuj avatar Aug 29 '18 02:08 oyeanuj

Hey @oyeanuj, great to hear that you have been trying it out.

Ouch, doesn't sound like a good experience! My initial thought is that you may not be using a placeholder, or perhaps your placeholder doesn't have a height that is representative of the content that it is trying to virtualise.

Would it be possible to throw up a codesandbox to illustrate the issue?

ctrlplusb avatar Aug 29 '18 20:08 ctrlplusb

@ctrlplusb thanks for the quick response!

you are right on the placeholder - i'm not using one. is that mandatory?

I'll try to reproduce my setup in a codesandbox! Do you have a template which I could modify?

oyeanuj avatar Aug 30 '18 23:08 oyeanuj

@ctrlplusb ping! Any thoughts on the questions above, especially on the placeholder one?

oyeanuj avatar Nov 13 '18 05:11 oyeanuj

Hey dude,

The placeholder isn't mandatory. This could be a buggy case.

If you could set up a simple codesandbox I would be happy to debug it and either do a fix for the library, or advice you on an alternative approach.

Sorry, I don't have a based sandbox configured for this. :(

ctrlplusb avatar Nov 13 '18 13:11 ctrlplusb