react-infinite-scroll-component icon indicating copy to clipboard operation
react-infinite-scroll-component copied to clipboard

Should this work in a functional component?

Open ElixirMike opened this issue 6 years ago • 10 comments

I am trying to implement this in a functionali component, but it's not working. should it work or does it only work from class based component?

ElixirMike avatar Apr 02 '20 21:04 ElixirMike

It works just fine with the functional component.

https://codesandbox.io/s/vigorous-borg-khsq3

RomanShabanov avatar Apr 05 '20 11:04 RomanShabanov

Stange, it's not working for me. Is there an issue when using it in a modal? That's how I'm trying to implement it.

ElixirMike avatar Apr 05 '20 15:04 ElixirMike

I'm also having problems using this lib inside a modal with functional components. The next function is not being called. I'm using Material-UI's modal component.

heniotierra avatar Apr 09 '20 18:04 heniotierra

@heniotierra I had the same problem, because my data has no enough data (only 4 objects) to activate a scrollable window. Try to reduce your navigator height. Im still trying to solve this problem.

brunnohofmann avatar Apr 13 '20 14:04 brunnohofmann

Same issue here. My next function isn't being called correctly, as @heniotierra

davidpelayo avatar Apr 21 '20 16:04 davidpelayo

Same issue here

atellezsazo avatar May 12 '20 11:05 atellezsazo

For next function to be called your component needs to have enough rows to force a scroll. The component attaches a listener on scroll and then calls the next function. You can try by fetching enough records to cause a scroll.

ankeetmaini avatar May 12 '20 11:05 ankeetmaini

Closing this issue as Functional components work too. Please open another with a repro. Thanks :)

ankeetmaini avatar May 12 '20 11:05 ankeetmaini

next function not work in modal dialog...

v1talii-dev avatar Dec 11 '21 16:12 v1talii-dev

@v1talii-dev coud you fix that issue on modals?

martin-landhi avatar Sep 12 '22 22:09 martin-landhi