mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Merge pull request #32612 from szdc/react-native-add-method-to-flatlist
[react-native] add missing flashScrollIndicators method to FlatList component
This commit is contained in:
Vendored
+5
@@ -4111,6 +4111,11 @@ export class FlatList<ItemT> extends React.Component<FlatListProps<ItemT>> {
|
||||
* by taps on items or by navigation actions.
|
||||
*/
|
||||
recordInteraction: () => void;
|
||||
|
||||
/**
|
||||
* Displays the scroll indicators momentarily.
|
||||
*/
|
||||
flashScrollIndicators: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -332,6 +332,14 @@ InteractionManager.runAfterInteractions(() => {
|
||||
}).then(() => "done");
|
||||
|
||||
export class FlatListTest extends React.Component<FlatListProps<number>, {}> {
|
||||
list: FlatList<any> | null = null;
|
||||
|
||||
componentDidMount(): void {
|
||||
if (this.list) {
|
||||
this.list.flashScrollIndicators();
|
||||
}
|
||||
}
|
||||
|
||||
_renderItem = (rowData: any) => {
|
||||
return (
|
||||
<View>
|
||||
@@ -345,6 +353,7 @@ export class FlatListTest extends React.Component<FlatListProps<number>, {}> {
|
||||
render() {
|
||||
return (
|
||||
<FlatList
|
||||
ref={list => (this.list = list)}
|
||||
data={[1, 2, 3, 4, 5]}
|
||||
renderItem={this._renderItem}
|
||||
ItemSeparatorComponent={this._renderSeparator}
|
||||
|
||||
Reference in New Issue
Block a user