useVirtualSnapshot()
function useVirtualSnapshot(model, events?): number;Re-render the current Preact component when selected model events publish.
Parameters
model
events?
number = VirtualScrollerEvent.RANGE
Returns
number
The selected numeric model revision.
Related examples
- Simple PrimitivespreactThis example builds a list from the adapter's lower-level model, layout, range, and item primitives instead of its high-level list binding.
- GridpreactThis example combines one vertical model and one horizontal model to virtualize a dynamic two-dimensional grid.
- Nested ContainerpreactThis example separates the native scroll owner from the element that contains the virtual range. Content can appear before the list while core still measures the nested offset and publishes the correct geometry.
- TablepreactThis example virtualizes dynamic rows without breaking native table semantics. Spacer rows represent content above and below the rendered range because a positioning wrapper cannot sit between tbody and tr.
- Event SubscriptionspreactThis example subscribes separate, small consumers to range and size events. Unrelated model changes stay out of each framework's broader render or reactive update path.
- Window ScrollpreactThis example uses the browser window as the native scroll owner while the virtual range remains nested inside ordinary page content.