[labs/virtualizer] `virtualize` directive only re-renders children if `items` or `renderItem` have changed
See original GitHub issueDescription
When using the virtualize
directive, children fail to re-render in response to certain types of data changes.
Specifically, children are only re-rendered if data within the items
array changes (or if the renderItem
template itself is replaced). This means that any changes to data stored outside the items
array will fail to trigger re-rendering, even if logic or bindings in the renderItem
template refer to the changed data.
Steps to Reproduce
- Go to the demo link
- Click “update selected” button
- See that selected changes in the second list, but not in the first.
Live Reproduction Link
Expected Results
selected
should change in both lists.
cc: @Westbrook
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
@lit-labs/virtualizer - npm
It requires a renderItem function for rendering virtual children, and an array of items to render. Say we are building an index page...
Read more >react-virtualized list item does not re-render with changed ...
MyItem is connected to a redux store and can be interacted with. However it's not reflecting any of the changes on the screen...
Read more >FlatList re-renders its items many times · Issue #24206 - GitHub
When I render FlatList with simple static data array (also with dynamic array), FlatList renders renderItem many times.
Read more >How to stop re-rendering lists in React? - Alex Sidorenko
React does not care whether “props changed” - it will render child components unconditionally just because the parent rendered!
Read more >GPU Accelerated Compositing in Chrome
Note also that some class names may have changed (e.g. RenderObject to ... RenderObjects are stored in a parallel tree structure, called the...
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 FreeTop 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
Top GitHub Comments
@graynorton I’ll update and include it in first round of functional tests this week.
Yay! I fixed the test fixture to demonstrate the noChange behavior and have updated the code in #3133 to return
this.render()
. Will get this through and release next. Thanks for your patience 😃