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.

GroupedVirtuoso is crashing when trying to rerender component

See original GitHub issue

We have component, which uses GroupedVirtuoso. Some state of our component is changed, which leads to call of render() function. As a result we have exception in GroupedVirtuoso: Requested offset outside of the known ones, index: 0

I am 110% sure, that data, which is passed to GroupedVirtuoso component is correct. In fact, i was able to reproduce issue with an example from Virtuoso official page.

I’m not good in web, so sorry in advance, why i did not provide a working example.

  1. Go https://virtuoso.dev/grouped-numbers/;
  2. Click on “Edit in StackBlitz” button;
  3. Editor should be opened;
  4. Before return() (15th line) add this: console.log("wassup");
  5. And you’ll get an error on right browser screen:
Error in /turbo_modules/react-virtuoso@0.14.0/dist/react-virtuoso.cjs.development.js (1321:13)  
Requested offset outside of the known ones, index: 0
  1. Click on “reload” button on right browser screen, and it will reload without issues;
  2. Modify anything in code (for example text, which is printed in console), and you’ll get an error again;

So, thing is, that we are getting such exception every time, when state of the component is modified, even if data, which is passed to GroupedVirtuoso was not changed.

May be there are some workaround for this issue? Using simple VirtuosoList is not an option: we need those sticky headers.

Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
petyosicommented, Mar 17, 2020

Thanks, I will repro the problem and release a fix - it should not be something to fix on your side.

1reaction
PauliusLiekiscommented, Mar 18, 2020

It seems to be fine now. Amazing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component crashes when re-render - Stack Overflow
And it works fine, but when I refresh the page my application tries to use data that haven't been fetched yet, therefor it...
Read more >
Troubleshooting React Virtuoso
React Virtuoso tries to hide as much complexity as possible while maintaining sensible behavior with any configuration.
Read more >
How to solve too many re-renders error in ReactJS?
After mounting a React component, it will listen to any React props or state that has changed. It will, by default, re-render the...
Read more >
How to stop re-rendering lists in React? - Alex Sidorenko
I only want to update one component in the list, but all of them re-render.
Read more >
What Causes a React Component to Re-Render - YouTube
In this video, I will go over what causes a react component to re-render.The base reason a component re-renders is because the props...
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