App crashes when "list" is changed in VirtuosoGrid
See original GitHub issuefirst off, this library is great and exactly what I need!
I am using the VirtuosoGrid component, I supply it an array of small objects (from redux). I am trying to allow a user to use a text input to search and filter the boxes in the grid, so I have the text input text filter the array that is passed to this grid, when the list is “filtered” my react app crashes because a component that did have one of the “items” is now getting undefined.
I’m probably missing something simple. But it seems like this should just work?
// user typed in "mi"
const searchText = 'z';
const list = [{a: 'Mike'}, {a: 'Sam'}....... {a: 'Michael'}];
// some logic to filter the list based on text input
const filteredList = list.filter(item => item.a === searchText);
// down way below in renderland
<VirtuosoGrid
totalCount={filteredList.length}
item={idx => <MyComponent item={filteredList[idx]} />}
/>
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[UWP] ListViews crashing app when data is updated - MSDN
If I give the data time to update before navigating to the list page everything is fine, and the new data is shown...
Read more >Troubleshooting React Virtuoso
List is jumping around or misbehaving#. The list relies on measuring the item sizes and dynamically updating its position based on the received...
Read more >react-virtuoso - Bountysource
I'm currently using the VirtuosoGrid component to render a long list of items ... you can now reset endReached by change the object...
Read more >when data is changed in real time database(firebase) app ...
Try this method, it worked for me FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference myRef = database.
Read more >Why is my React app crashing when changing an input?
330K subscribers in the reactjs community. A community for learning and developing web applications using React by Facebook.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thank you! Reproduced the problem on my side, confirming it as a bug. Will figure out a fix and publish a new version this week.
Hey, @mcabs3 that should work from what I see, but you may have found a bug in the rendering mechanism. Can you reproduce it in stackblitz or codesandbox? I will take a look.
Cheers,