Closed stefanJi closed 1 year ago
Take a look a this example: https://github.com/petyosi/react-virtuoso/blob/master/examples/chat.tsx. You need to reset the component when you load a new data set with the key property.
@petyosi I have set key at the parent component
<ChatRoom key={curRoom} cur={curRoom} data={list[curRoom]} />
After updating the demo and add key to virtuoso, the behavior is still the same.
<Virtuoso
key={`chat-${cur}`}
/>
True, I did not see that. I can't really distinguish if the blinking shows the previous content, or it's a matter of readjustment with the current data set. At any case, if you have variable sized items, you should use a default item height setting. I believe that this version works better.
Describe the bug
when set initialTopMostItemIndex, on the first frame, the previous content is rendered first
Reproduction
https://codesandbox.io/s/virtuoso-demo-jump-gypfeh?file=/src/App.tsx
Screenshots
https://github.com/petyosi/react-virtuoso/assets/15273198/22455612-ee91-4430-9f4e-904ae3efd3c3
Desktop (please complete the following information):
Additional context Add any other context about the problem here.