From 2ca5a06c5e3c3665ab9903fe1669e76ed57179a4 Mon Sep 17 00:00:00 2001 From: AlexAlexandre Date: Thu, 9 Dec 2021 15:08:05 -0300 Subject: [PATCH] updating the IRoomListProps --- app/views/RoomView/List/List.tsx | 23 +++++++---------------- app/views/RoomView/index.tsx | 2 +- 2 files changed, 8 insertions(+), 17 deletions(-) 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;