TanStackT
TanStack2y ago
3 replies
moderate-tomato

What is the `sync` parameter for in the `Virtualizer.onChange` function?

Howdy! There's a parameter in the virtualizer that's not documented - the onChange function's sync parameter

Docs: https://tanstack.com/virtual/latest/docs/api/virtualizer#onchange

Fn Signature: https://github.com/TanStack/virtual/blob/f0537588c4304fda7c231124d73cc4cbcec618a8/packages/virtual-core/src/index.ts#L250C3-L253C12

What's the sync param for? I'm willing to submit a PR to update the docs if someone can help me out here.
The Virtualizer class is the core of TanStack Virtual. Virtualizer instances are usually created for you by your framework adapter, but you do receive the virtualizer directly.

`tsx
GitHub
🤖 Headless UI for Virtualizing Large Element Lists in JS/TS, React, Solid, Vue and Svelte - TanStack/virtual
virtual/packages/virtual-core/src/index.ts at f0537588c4304fda7c231...
Was this page helpful?