question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[labs/virtualizer] `virtualize` directive only re-renders children if `items` or `renderItem` have changed

See original GitHub issue

Description

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

  1. Go to the demo link
  2. Click “update selected” button
  3. See that selected changes in the second list, but not in the first.

Live Reproduction Link

Demo

Expected Results

selected should change in both lists.

cc: @Westbrook

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
usergeniccommented, Jun 22, 2022

@graynorton I’ll update and include it in first round of functional tests this week.

1reaction
usergeniccommented, Jul 19, 2022

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found