From b0315cb558c7f7bc9fb2c5816fdb6f5b8722fad4 Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 6 Jun 2024 16:14:34 -0700 Subject: [PATCH] change `header` and `footer` to be in line with `emptyComponent` --- src/view/com/util/List.web.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/view/com/util/List.web.tsx b/src/view/com/util/List.web.tsx index da286845bf..018ca0065b 100644 --- a/src/view/com/util/List.web.tsx +++ b/src/view/com/util/List.web.tsx @@ -73,23 +73,23 @@ function ListImpl( ) } - let header: JSX.Element | null = null + let headerComponent: JSX.Element | null = null if (ListHeaderComponent != null) { if (isValidElement(ListHeaderComponent)) { - header = ListHeaderComponent + headerComponent = ListHeaderComponent } else { // @ts-ignore Nah it's fine. - header = + headerComponent = } } - let footer: JSX.Element | null = null + let footerComponent: JSX.Element | null = null if (ListFooterComponent != null) { if (isValidElement(ListFooterComponent)) { - footer = ListFooterComponent + footerComponent = ListFooterComponent } else { // @ts-ignore Nah it's fine. - footer = + footerComponent = } } @@ -341,7 +341,7 @@ function ListImpl( topMargin={(onStartReachedThreshold ?? 0) * 100 + '%'} /> )} - {header} + {headerComponent} {!data || data.length === 0 ? emptyComponent : (data as Array)?.map((item, index) => { @@ -365,7 +365,7 @@ function ListImpl( bottomMargin={(onEndReachedThreshold ?? 0) * 100 + '%'} /> )} - {footer} + {footerComponent} )