Replies: 1 comment
-
Performance sections of the docs actually suggests to https://virtuoso.dev/#performance It appears that this is therefore expected behavior. Would still appreciate an example in documentation of appending to a large list, e.g. I would expect that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am confused what is the correct way to append items when you have very large array.
As an example, I've tried using
useRef
to append to the array and then force refresh.https://codesandbox.io/s/react-virtuoso-component-list-re-render-forked-92iwn?file=/src/App.js
This works, however, it is still recalculating
itemContent
every timetotalCount
, i.e. I would not expect it to try to re-render elements that are already visible. Therefore, I suspect that I am doing something wrong.We can obviously memoize whatever element
itemContent
returns, but again, I am just not sure if this is the correct approach.Beta Was this translation helpful? Give feedback.
All reactions