Comments (3)
@piecyk Works, thanks. One question: It seems like I have abused the old functionality for my initial lazy loading to work and I want to know if this is intentional.
The infinite scroll example suggests setting allRows.length + 1
as count
for lazy loading. I used this behavior for showing a loading animation when initially loading elements (initially allRows.length
is 0
), knowing that the last / only item in the list is the 'loading' item. Now that no items are returned, I cannot identify a loading item anymore, also the getTotalSize()
returns 0.
I got a few workarounds for this to work for me, might as well move to TanStack Query but I wanted to make sure this current behavior is intentional. I can provide a Codesandbox if necessary
from virtual.
@HRworksVid i would say that it's expected, as we should not return rows when there is no content, the above example is working fine for me. I think you are trying to render conditionally and want to trigger the call before the scroll element is mounted?
Overall my current approach regarding infinite scroll is using IntersectionObserver to call next request, https://codesandbox.io/p/sandbox/focused-http-d2kyky as imho it's kinda simpler.
from virtual.
Hey @piecyk, that's an interesting approach. I used the one from the infinite scroll example, here you can see it working with beta61: https://codesandbox.io/p/sandbox/rough-dawn-p3tk7g
Would it be better to use this one or the other? Might as well update the example in the docs maybe?
from virtual.
Related Issues (20)
- no measeure element height for useWindowVirtualizer() HOT 2
- Total size is calculated incorrectly for masonry grids HOT 1
- virtualizer.getVirtualItems() mismatches with number provided in count attribute during initialisation
- Docs: Embedded StackBlitz playground cannot find example code HOT 1
- react-virtual v3.0.* is using strict version of virtual-core 3.0.0 HOT 1
- Uncaught Error: Maximum update depth exceeded. When we add styles for first row.
- svelte-virtual: no release created since 3.0.4 HOT 2
- useVirtualizer is not a function error after upgrading to 3.1.2
- Tanstack Virtual freezes when using React DevTools
- useVirtualiser is undefined - build issue HOT 1
- Rendering lag when using virtualised for both rows and columns along with Tanstack/table HOT 2
- Stackblitz not supporting Firefox renders the examples section useless for Firefox users.
- VirtualItem measurements are incorrect when getEstimateSize returns a string HOT 1
- Virtualizer.scrollToIndex - Uncaught error when list is empty HOT 6
- useWindowVirtualizer with measureElement, hidden list, and auto-loading items causes getVirtualItems length to go to infinity
- virtualizer.getVirtualItems() return zero items for vanilla js project HOT 2
- Tanstack virtual docs search is broken
- Scroll to not working + warning about flushSync HOT 2
- useVirtualizer not working in Vue Test Utils HOT 2
- flushSync was called from inside a lifecycle method HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from virtual.