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.

Dynamically updating count seems to not trigger an update

See original GitHub issue

Describe the bug

When dataCount changes from 0 to 1000, the list is not updated.

const rowVirtualizer = useVirtualizer({
  count: dataCount,
  getScrollElement: () => tableContainer.current,
  estimateSize: () => 21,
  overscan: 5
});

Your minimal, reproducible example

https://codesandbox.io/s/react-virtual-only-one-item-is-rendered-at-first-bfoj5r?file=/src/main.tsx

Steps to reproduce

Checkout following sandbox: https://codesandbox.io/s/react-virtual-only-one-item-is-rendered-at-first-bfoj5r?file=/src/main.tsx At first glance only one row will be visible. This is because on first render dataCount is 0, but then it changes to 1000, but the list is not updated.

Expected behavior

All items, which fit in the tableContainer, should be rendered.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

-OS Linux Ubuntu Browser: Firefox 103.0b9 (64-bit)

tanstack-virtual version

3.0.0-beta.14

TypeScript version

No response

Additional context

#353

Terms & Code of Conduct

  • I agree to follow this project’s Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:8
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
christiankaindlcommented, Aug 12, 2022

I don’t know if that’s intentional, but the PR in #366 was not merged yet

1reaction
SvetaSRcommented, Oct 21, 2022

Hi, any updates for this issue? 😦 I really don’t like that we have to use a workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chosen plugin not updating dynamic content - Stack Overflow
First of all, you're triggering the event on a string with your code, as .val() returns a string. Try doing it separately, or...
Read more >
Trigger to change some upsert records from update to insert
Hello, We have a daily scheduled import of several records to a custom object. The import is set as an "upsert," and is...
Read more >
Thinking in Compose | Jetpack Compose - Android Developers
In Compose's declarative approach, widgets are relatively stateless and do not expose setter or getter functions. In fact, widgets are not exposed as...
Read more >
Automatically apply VM configuration updates in a MIG
These instances count toward the maxUnavailable number. ... To the Updater, this update appears complete, so no other instances are updated, ...
Read more >
Fix problems with dynamic group memberships - Azure AD
Troubleshooting tips for dynamic group membership in Azure Active ... I configured a rule on a group but no memberships get updated in...
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