diff --git a/app/views/RoomView/List/List.tsx b/app/views/RoomView/List/List.tsx index adda14181..c470eb806 100644 --- a/app/views/RoomView/List/List.tsx +++ b/app/views/RoomView/List/List.tsx @@ -1,9 +1,10 @@ import React from 'react'; -import { FlatList, StyleSheet } from 'react-native'; +import { FlatList, FlatListProps, StyleSheet } from 'react-native'; import Animated from 'react-native-reanimated'; import { isIOS } from '../../../utils/deviceInfo'; import scrollPersistTaps from '../../../utils/scrollPersistTaps'; +import { IRoomItem } from '../index'; const AnimatedFlatList = Animated.createAnimatedComponent(FlatList); @@ -16,26 +17,16 @@ const styles = StyleSheet.create({ } }); -interface IRoomListProps { - listRef: any; - onScroll?: any; - scrollEventThrottle?: number; - data?: any; - renderItem?: Function; - onEndReached?: Function; - ListFooterComponent?: Function; - onScrollToIndexFailed?: Function; - onViewableItemsChanged?: Function; - viewabilityConfig?: any; - refreshControl?: any; +interface IRoomListProps extends FlatListProps { + listRef: React.Ref; } -const List = ({ listRef, ...props }: IRoomListProps) => ( - // @ts-ignore +const List = ({ listRef, ...props }: IRoomListProps): JSX.Element => ( item.id} + // @ts-ignore + keyExtractor={(item: IRoomItem) => item.id} contentContainerStyle={styles.contentContainer} style={styles.list} inverted diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 31c1ac83b..f45e78c4b 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -137,7 +137,7 @@ interface IRoomViewProps { } export interface IRoomItem { - id?: string; + id: string; t: string; rid: string; tmid?: string;