gnir-work / react-window-dynamic-list

A naive approach to virtualizing a dynamically sized list
49 stars 9 forks source link

Enable itemData prop #29

Closed SpadarShut closed 3 years ago

SpadarShut commented 3 years ago

Passes itemData prop to item rendering function.

This is a PR with the code from @akraines , https://github.com/akraines/react-window-dynamic-list/commit/c0ee642bbd3de6ca7bd44ed60cb905ac57204579

gnir-work commented 3 years ago

Hey, After merging your PR I noticed a small bug. VariableSizeList passes the whole itemData prop to its children while you pass the current index to the measureIndex component childrens. This resulted in incorrect measurements which led to overlapping elements :( The fix is located in this commit - https://github.com/gnir-work/react-window-dynamic-list/commit/223e3ad2c779f1fc1cc1cdd6647e499f116cf289 Any way you can receive this feature at @.***

And again, Thanks for the contribution to the project! :D

On Sun, Jul 11, 2021 at 4:51 PM Pavel Shut @.***> wrote:

Passes itemData prop to item rendering function.

This is a PR with the code from @akraines https://github.com/akraines , @.*** https://github.com/akraines/react-window-dynamic-list/commit/c0ee642bbd3de6ca7bd44ed60cb905ac57204579

You can view, comment on, or merge this pull request online at:

https://github.com/gnir-work/react-window-dynamic-list/pull/29 Commit Summary

  • Enable itemData prop

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gnir-work/react-window-dynamic-list/pull/29, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLMGSSJDR47PGSLRQBIMHLTXGOU5ANCNFSM5AFKCE4Q .

SpadarShut commented 3 years ago

Thanks, I didn't actually test the code, just submitted someone else's, because I needed this feature in my project. Totally agree all of the itemData should be passed.

And thanks for maintaining this project!

gnir-work commented 3 years ago

No problem :) In case you have any other requirements while developing the project I would love to hear and help if possible.

On Sun, Jul 11, 2021, 23:42 Pavel Shut @.***> wrote:

Thanks, I didn't actually test the code, just submitted someone else's, because I needed this feature in my project. Totally agree all of the itemData should be passed.

And thanks for maintaining this project!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gnir-work/react-window-dynamic-list/pull/29#issuecomment-877858372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLMGSS3UHVDZMEO74H4W4LTXH64XANCNFSM5AFKCE4Q .