ScrollViewHandle
Imperative handle exposed by ScrollView via React.forwardRef.
Example
Section titled “Example”const ref = useRef<ScrollViewHandle>(null);<ScrollView ref={ref} style={{ height: 20 }}> {items.map(…)}</ScrollView>
// Scroll to item index 10, centered:ref.current?.scrollToIndex(10, { block: "center" });Methods
Section titled “Methods”scrollTo()
Section titled “scrollTo()”scrollTo(node, options?): void;Scroll to make the given node visible.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
node | GlyphNode |
options? | ScrollIntoViewOptions |
Returns
Section titled “Returns”void
scrollToIndex()
Section titled “scrollToIndex()”scrollToIndex(index, options?): void;Scroll to make the child at index visible (even off-screen items).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
index | number |
options? | ScrollIntoViewOptions |
Returns
Section titled “Returns”void