diff --git a/Libraries/Lists/FlatList.d.ts b/Libraries/Lists/FlatList.d.ts index 331c161e0dc99b..9796869d3dbce7 100644 --- a/Libraries/Lists/FlatList.d.ts +++ b/Libraries/Lists/FlatList.d.ts @@ -206,6 +206,7 @@ export class FlatList extends React.Component< scrollToItem: (params: { animated?: boolean | null | undefined; item: ItemT; + viewOffset?: number | undefined; viewPosition?: number | undefined; }) => void; diff --git a/Libraries/Lists/FlatList.js b/Libraries/Lists/FlatList.js index 3da7714a670b29..56748eaf75240d 100644 --- a/Libraries/Lists/FlatList.js +++ b/Libraries/Lists/FlatList.js @@ -334,6 +334,7 @@ class FlatList extends React.PureComponent, void> { scrollToItem(params: { animated?: ?boolean, item: ItemT, + viewOffset?: number, viewPosition?: number, ... }) { diff --git a/Libraries/Lists/VirtualizedList.d.ts b/Libraries/Lists/VirtualizedList.d.ts index 3a4bbfe0c0c9a7..eaef385999f51d 100644 --- a/Libraries/Lists/VirtualizedList.d.ts +++ b/Libraries/Lists/VirtualizedList.d.ts @@ -11,7 +11,12 @@ import type * as React from 'react'; import type {LayoutChangeEvent} from '../../types'; import {StyleProp} from '../StyleSheet/StyleSheet'; import {ViewStyle} from '../StyleSheet/StyleSheetTypes'; -import type {ScrollViewProps} from '../Components/ScrollView/ScrollView'; +import type { + ScrollResponderMixin, + ScrollView, + ScrollViewProps, +} from '../Components/ScrollView/ScrollView'; +import type {View} from '../Components/View/View'; export interface ViewToken { item: any; @@ -98,6 +103,7 @@ export class VirtualizedList extends React.Component< scrollToItem: (params: { animated?: boolean | undefined; item: ItemT; + viewOffset?: number | undefined; viewPosition?: number | undefined; }) => void; @@ -113,6 +119,13 @@ export class VirtualizedList extends React.Component< }) => void; recordInteraction: () => void; + + getScrollRef: () => + | React.ElementRef + | React.ElementRef + | null; + + getScrollResponder: () => ScrollResponderMixin | null; } /** diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index cf11abbfaf4138..a6114ccaf0015c 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -263,6 +263,7 @@ export default class VirtualizedList extends StateSafePureComponent< scrollToItem(params: { animated?: ?boolean, item: Item, + viewOffset?: number, viewPosition?: number, ... }) {