updating the IRoomListProps

This commit is contained in:
AlexAlexandre 2021-12-09 15:08:05 -03:00
parent 0694666a21
commit 2ca5a06c5e
2 changed files with 8 additions and 17 deletions

View File

@ -1,9 +1,10 @@
import React from 'react'; import React from 'react';
import { FlatList, StyleSheet } from 'react-native'; import { FlatList, FlatListProps, StyleSheet } from 'react-native';
import Animated from 'react-native-reanimated'; import Animated from 'react-native-reanimated';
import { isIOS } from '../../../utils/deviceInfo'; import { isIOS } from '../../../utils/deviceInfo';
import scrollPersistTaps from '../../../utils/scrollPersistTaps'; import scrollPersistTaps from '../../../utils/scrollPersistTaps';
import { IRoomItem } from '../index';
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList); const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
@ -16,26 +17,16 @@ const styles = StyleSheet.create({
} }
}); });
interface IRoomListProps { interface IRoomListProps extends FlatListProps<IRoomItem> {
listRef: any; listRef: React.Ref<FlatList>;
onScroll?: any;
scrollEventThrottle?: number;
data?: any;
renderItem?: Function;
onEndReached?: Function;
ListFooterComponent?: Function;
onScrollToIndexFailed?: Function;
onViewableItemsChanged?: Function;
viewabilityConfig?: any;
refreshControl?: any;
} }
const List = ({ listRef, ...props }: IRoomListProps) => ( const List = ({ listRef, ...props }: IRoomListProps): JSX.Element => (
// @ts-ignore
<AnimatedFlatList <AnimatedFlatList
testID='room-view-messages' testID='room-view-messages'
ref={listRef} ref={listRef}
keyExtractor={(item: any) => item.id} // @ts-ignore
keyExtractor={(item: IRoomItem) => item.id}
contentContainerStyle={styles.contentContainer} contentContainerStyle={styles.contentContainer}
style={styles.list} style={styles.list}
inverted inverted

View File

@ -137,7 +137,7 @@ interface IRoomViewProps {
} }
export interface IRoomItem { export interface IRoomItem {
id?: string; id: string;
t: string; t: string;
rid: string; rid: string;
tmid?: string; tmid?: string;