TanStack

T

TanStack

TanStack is a community of passionate software engineers striving for high-quality, open-source software for web devs

Join

react-query-questions

solid-query-questions

table-questions

virtual-questions

router-questions

react-charts-questions

ranger-questions

vue-query-questions

svelte-query-questions

bling-questions

form-questions

angular-query-questions

start-questions

db-questions

start-showcase

router-showcase

📣-announcements

deep-jade
deep-jade3/10/2024

Virtualized items not updating more than once

I'm defining my list like this (attached snippet on next post). When I load my page the list updates its elements (if I scroll before it loads I get a different section) then it never updates again, leaving whitespace...
passive-yellow
passive-yellow3/6/2024

Resizing dynamically sized virtual rows causes jittery behavior

I am using measureElement to virtualize dynamically sized elements. Everything works well but I have one problem when dynamically changing the rows size through conditional rendering. Each row is passed a boolean prop based on some conditions, and when a certain action happens, the row will display/hide some content. When this happens, specifically when the row grows in size (triggering the resizeObserver from measureElement), this behavior is jittery for a split second. It seems that text is displayed on top of each other until it finishes adjusting. Any ideas on how to fix this? This is my virtualizer instance: ``` const virtualizer = useVirtualizer({...
like-gold
like-gold2/28/2024

virtualization question!

Hey, I have 3 layers of data, like an array of grandparents> having parents> and then children, I want to virtualize children, anyone knows how to do that? Thanks...
metropolitan-bronze
metropolitan-bronze2/23/2024

Virtualized Tree

Hi, I'm back 🙂 I had to pause the virtualized tree for a while because of life... I'm still struggling unfortunately and maybe I need to approach it differently but my solution feels so close and if we could solve this puzzle I think it could be one of the better react tree solutions out there. In short, we are using the power of react components to create the tree structure with react state for expand/collapse, contexts for tree level and indentation. But the resulting DOM output is a flat list which should make it suitable for windowing/virtualization. ...
flat-fuchsia
flat-fuchsia2/12/2024

Significant scrolling performance hit from scrollLeft?

This is a re-post of https://github.com/TanStack/virtual/discussions/667. Perhaps Discord is more active 🙂 I am building a data grid with the tanstack react-table + react-virtual combo but I am having troubling making the scrolling performance better. When profiling with chrome dev tools, I found for every scroll event, there is half time spent on Recalculate Style and Layout, the stack trace points to get scrollLeft from the observeElementOffset of react-virtual....
No description
flat-fuchsia
flat-fuchsia2/12/2024

Missing documentation on scrollingDelay

I am recently trying to improve scrolling performance of a data grid built on react-virtual. I found setting a much lower scrollingDelay greatly improve the perceived scrolling performance. I didn't know about this prop until digging into the source code, as it wasn't mentioned anywhere in documentation. Shouldn't we add some documentation for it?...
sunny-green
sunny-green2/10/2024

Is there a documented way to make a responsive grid list?

Can you share an example of a responsive grid list? I tried using lanes, dynamically substituting the number of lines there, but it didn't work
wise-white
wise-white2/8/2024

Problems with list rendering with ssr

Hello, please tell me the solution for tanstack/virtual 3.0.4 I use virtualization for a list on an ssr page, without initialRect tags are not rendered on the server side, which is exactly what I need. For rendering on the server side, I added an initialRect accordingly, but with initialRect on the client, during the first render I get the entire list without virtualization, which is noticeable, how can I fix it? ``` const virtualList = useVirtualizer({...
correct-apricot
correct-apricot2/5/2024

Parent components behaving unexpectedly

Styling and the ref={(node) => rowVirtualizer.measureElement(node)} effecting the parent components. if i comment out this code everything works: ...
stormy-gold
stormy-gold2/5/2024

Duplicated fetching with React Query + React Table + Virtual and MUI Table

Hi everyone, I am trying to create a virtual table with query + table + virtual. I am using the following versions: "@tanstack/react-virtual": "3.0.2",...
No description
passive-yellow
passive-yellow2/5/2024

Dynamic item sizes causes list to jitter when items are removed

Hey all. Thanks for this amazing library. Ive managed to get my virtual list working in my React app using the useVirtualizer hook. My use case is a chat UI and the virtual list displays messages in a column orientation. Everything works great, and sending messages is smooth. My issue is when I delete a message, depending on where it is in the window, sometimes this deletion is very jittery and sometimes its smooth. All the messages are dynamically sized and my estimate size function returns the size that is for the most common case. There is no hard limit on how big an item is because messages can have multiple rows of content. Here is my visualizer:...
extended-yellow
extended-yellow2/2/2024

Toggling visibility on items leaving empty space

Heya, using the window scroll, i'm trying to implement visibility toggle. What i have for data is a flattened tree and when i want to hide children of some node looks like it doesn't recalculate the positions of elements that are below the collapsed node so i'm left with blank space. What i've tried so far: ...
metropolitan-bronze
metropolitan-bronze2/1/2024

Recursive structure

Is it possible to use the virtualizer without looping over the virtual items? My items is in a recursive structure but the resulting dom elements are flattened. But I'm not sure how to figure out what item should be rendered without using getVirtualItems() function.
correct-apricot
correct-apricot1/30/2024

[Possible Bug] getTotalSize is calculated incorrectly.

I have a waterfall style of grid with 4 lanes and each item can be a different height. I have the calculations correct but sometimes at the bottom content gets cut off. I was banging my head against the wall but then I realized there might be a bug and just wanted to confirm. You can see the list of measurements in the image. You can see index 16 as an end that is bigger than index 17, but getTotalSize() only takes the last item of the array into consideration. This is taken straight from the source:...
No description
extended-salmon
extended-salmon1/30/2024

Responsive virtualizer

Hi, How can I make my virtualizer responsive ? can't find any example. Should I check for window size / resize and update the estimateSize ? Got issue adding margins between virtual items too, I have to add margins to the estimateSize to get them work.. any help would be appreciated, thanks 🙂...
deep-jade
deep-jade1/17/2024

Most of the react example sandbox are down for me

All of them just error out with this: And there is no documentation except these examples. It doesent help if I sign in or not. I think it would really be helpful if there was documentation beside these because codesandbox is really slow. Also stackblitz has been stellar in terms of performance. If you dont mind me suggesting maybe it is a better alternative. Let me know if I can help....
No description
wise-white
wise-white12/28/2023

Dynamic Virtualizer - when scrolling through touchpad it causes flicker

Hey all, I was wondering if any of you have tried implementing a dynamic virtualizer with smooth scroll. I am rendering a list where the height of the items aren't fixed and calculated during render time. For e.g. list item 1 could be of 200 x 400 px and item 2 could be 200 x 900 px. Finding an appropriate estimateSize seems impossible as list item dimensions vary a lot. My main issue is scroll flickering. Items blink a lot when scrolling down and up, not sure what could be causing that. My virtualizer looks like this const virtualizer = useVirtualizer({...
optimistic-gold
optimistic-gold12/26/2023

setting scroll position when using infinite query with maxpages

I’m using virtual with infinite query. Everything was working pretty well, but then I set the maxpages on infinite query to prevent running out of memory on especially large lists. This works on the query side, but I noticed that the scroll position in my list stops updating when I reach the page equal to the max page (in my case 5). I’ve been able to work around this by manually setting the scroll index to a value equal to one page fewer items (4000 for my 5 pages of 1000 items). Is this normal...
like-gold
like-gold12/7/2023

Is there a way to access instance of the virtualizer from another react component?

I have a page with a virtual scrolling window of items, and in the page header I have a nav where I would like to use the scrollToIndex() function to scroll to specific indexes in the list of virtual items. The nav is not a parent or child of the component where the items are rendered. Is there a way to call scrollToIndex from outside of the component where the virtualizer was instantiated?
harsh-harlequin
harsh-harlequin12/7/2023

Window Virtualizer dynamic item sizes and scroll jitter

So I'm using svelte with each item in the list being dynamiclly sized with pictures loaded from the web, and videos. The main issue I'm facing rn is that i can't scroll past a certain point where it just jitters and the scroll stays there, how do I deal with this?