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

Shifting all items in a list #757

Open
szszoke opened this issue Mar 6, 2024 · 0 comments
Open

Shifting all items in a list #757

szszoke opened this issue Mar 6, 2024 · 0 comments

Comments

@szszoke
Copy link

szszoke commented Mar 6, 2024

I am looking at my options for implementing a list that would be used for displaying the last N items of a growing collection. The items would have variable height.

In reality, the collection wouldn't grow and instead old items would be removed to make space for new items once there are N items.

The end result is the same, however: once the collection has grown to N items, I have to call resetAfterIndex(0) every time the collection has been shifted (an old row removed and a new row added).

I haven't actually tried this and the performance I get might be good enough, but still, I was wondering if someone had implemented anything similar with react-window.

I think if I run into performance issues from having to re-measure the item heights so often then my best bet is to keep my own height cache and index that cache in a way that doesn't depend on the item index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant