From ca5d4bff0cf3717c1c334c87dee926adea7c5e21 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 27 Aug 2025 20:35:41 -0500 Subject: [PATCH] Add RefreshControl --- src/components/List/index.tsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/List/index.tsx b/src/components/List/index.tsx index a3ba87eabe..16ced38363 100644 --- a/src/components/List/index.tsx +++ b/src/components/List/index.tsx @@ -1,5 +1,10 @@ import {forwardRef, useMemo} from 'react' -import {type FlatList, type FlatListProps, type ViewToken} from 'react-native' +import { + type FlatList, + type FlatListProps, + RefreshControl, + type ViewToken, +} from 'react-native' import Animated, { type FlatListPropsWithLayout, useAnimatedScrollHandler, @@ -87,6 +92,20 @@ export const List = forwardRef(function List( ] }, [props.onItemSeen]) + let refreshControl + if (props.refreshing !== undefined || props.onRefresh !== undefined) { + refreshControl = ( + + ) + } + return ( ( props.headerOffset ? {x: 0, y: props.headerOffset * -1} : undefined } scrollsToTop={!activeLightbox} + refreshControl={refreshControl} {...(props as FlatListPropsWithLayout)} style={[ /*