From ba664577f2418f6760887a0aad3b822b2321cf17 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Tue, 14 Feb 2023 17:51:17 +0530 Subject: [PATCH] fix: empty state component was falsely inverted --- .../components/MessageList/MessageList.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/package/src/components/MessageList/MessageList.tsx b/package/src/components/MessageList/MessageList.tsx index 365beede08..9c04cd5a5e 100644 --- a/package/src/components/MessageList/MessageList.tsx +++ b/package/src/components/MessageList/MessageList.tsx @@ -956,10 +956,19 @@ const MessageListWithContext = < }); } - const renderListEmptyComponent = () => ( - - - + const shouldApplyAndroidWorkaround = + inverted && Platform.OS === 'android' && Platform.Version >= 33; + + const renderListEmptyComponent = useCallback( + () => ( + + + + ), + [EmptyStateIndicator, shouldApplyAndroidWorkaround], ); if (!FlatList) return null; @@ -979,9 +988,6 @@ const MessageListWithContext = < return null; }; - const shouldApplyAndroidWorkaround = - inverted && Platform.OS === 'android' && Platform.Version >= 33; - return (