-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
renderItem is call for all data items, even if windowSize is specified #362
Comments
Hi, bro @dohooo. You created nice library. Versions:
Smartphone
PS: @Aure77 Did you find out the solution? |
I found that this render problem happen only on first render. After that, windowSize is taken in account. |
Thank you. I already found the problem in my code. The renderItem method had external dependency which were causing huge number of re-renders. |
If you wouldn't mind, could you elaborate on what you did to fix this? I'm currently running into the same issue. EDIT: I was able to figure out why I had a large number of re-renders. It looks like I had the carousel's |
@tasgon I did small research as well and found out that this lib is not good for big data arrays. I started making the library without this limitation, but it's not ready for now. |
I created a PR to hopefully fix this, but it needs some more work with the unit testing. In the meantime you can use the following patch. I have tested it with all of the use cases I have, but more eyes would be helpful.
|
@klandell awesome work thank you very much ! |
Before, even if the limit of the number of render is set, it will render one more layer of BaseLayout, which makes the performance can not be maximized, and now the optimization makes BaseLayout will not render any more, even if the number of data is 1 million, it will only render the specified amount of render. Performance has improved dramatically. fix #352, fix #362, fix #258, fix #478
Describe the bug
If you pass a large amount of data to carousel & set
windowSize
to a small value (ex: 3) to limit the amount of items to be pre-rendered. All elements are still rendered.To Reproduce
set
windowSize
to 3 &data
with a lot of items. Then add "console.log" inrenderItem
method. You will see that every item are rendered at first launch.Expected behavior
Only 3 items should rendered on launch & then rendered on snap.
Versions (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: