Skip to content

ScrollViewHandle

Imperative handle exposed by ScrollView via React.forwardRef.

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" });
scrollTo(node, options?): void;

Scroll to make the given node visible.

ParameterType
nodeGlyphNode
options?ScrollIntoViewOptions

void


scrollToIndex(index, options?): void;

Scroll to make the child at index visible (even off-screen items).

ParameterType
indexnumber
options?ScrollIntoViewOptions

void