Skip to content

Commit 805bc2b

Browse files
committed
fix: fix getNativeScrollRef return type for FlatList
1 parent c3a7ce3 commit 805bc2b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

packages/react-native/Libraries/Lists/FlatList.d.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type {
1515
ViewabilityConfig,
1616
} from '@react-native/virtualized-lists';
1717
import type {ScrollViewComponent} from '../Components/ScrollView/ScrollView';
18+
import {HostInstance} from '../../types/public/ReactNativeTypes';
1819
import type {StyleProp} from '../StyleSheet/StyleSheet';
1920
import type {ViewStyle} from '../StyleSheet/StyleSheetTypes';
2021
import type {View} from '../Components/View/View';
@@ -229,13 +230,10 @@ export abstract class FlatListComponent<
229230
getScrollResponder: () => React.JSX.Element | null | undefined;
230231

231232
/**
232-
* Provides a reference to the underlying host component
233+
* Returns a reference to the underlying native scroll view, or null if the
234+
* native instance is not mounted.
233235
*/
234-
getNativeScrollRef: () =>
235-
| React.ComponentRef<typeof View>
236-
| React.ComponentRef<typeof ScrollViewComponent>
237-
| null
238-
| undefined;
236+
getNativeScrollRef: () => HostInstance | null;
239237

240238
getScrollableNode: () => any;
241239

0 commit comments

Comments
 (0)