From df5ff1b72e8c5769875cafe793f840b3aabe4eb3 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 17 Nov 2023 10:46:59 -0600 Subject: [PATCH] Override scrollRef types on profile --- src/view/screens/Profile.tsx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index 268f4f21f0..30c30d438b 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -7,7 +7,7 @@ import {useLingui} from '@lingui/react' import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types' import {withAuthRequired} from 'view/com/auth/withAuthRequired' import {ViewSelectorHandle} from '../com/util/ViewSelector' -import {CenteredView} from '../com/util/Views' +import {CenteredView, FlatList} from '../com/util/Views' import {ScreenHider} from 'view/com/util/moderation/ScreenHider' import {Feed} from 'view/com/posts/Feed' import {ProfileLists} from '../com/lists/ProfileLists' @@ -231,7 +231,9 @@ function ProfileScreenLoaded({ headerHeight={headerHeight} isFocused={isFocused} isScrolledDown={isScrolledDown} - scrollElRef={scrollElRef} + scrollElRef={ + scrollElRef as React.MutableRefObject | null> + } /> )} {({onScroll, headerHeight, isFocused, isScrolledDown, scrollElRef}) => ( @@ -242,7 +244,9 @@ function ProfileScreenLoaded({ headerHeight={headerHeight} isFocused={isFocused} isScrolledDown={isScrolledDown} - scrollElRef={scrollElRef} + scrollElRef={ + scrollElRef as React.MutableRefObject | null> + } /> )} {({onScroll, headerHeight, isFocused, isScrolledDown, scrollElRef}) => ( @@ -253,7 +257,9 @@ function ProfileScreenLoaded({ headerHeight={headerHeight} isFocused={isFocused} isScrolledDown={isScrolledDown} - scrollElRef={scrollElRef} + scrollElRef={ + scrollElRef as React.MutableRefObject | null> + } /> )} {showLikesTab @@ -271,7 +277,9 @@ function ProfileScreenLoaded({ headerHeight={headerHeight} isFocused={isFocused} isScrolledDown={isScrolledDown} - scrollElRef={scrollElRef} + scrollElRef={ + scrollElRef as React.MutableRefObject | null> + } /> ) : null} @@ -279,7 +287,9 @@ function ProfileScreenLoaded({ ? ({onScroll, headerHeight, isFocused, scrollElRef}) => ( | null> + } onScroll={onScroll} scrollEventThrottle={1} headerOffset={headerHeight} @@ -291,7 +301,9 @@ function ProfileScreenLoaded({ ? ({onScroll, headerHeight, isFocused, scrollElRef}) => ( | null> + } onScroll={onScroll} scrollEventThrottle={1} headerOffset={headerHeight} @@ -318,7 +330,7 @@ interface FeedSectionProps { headerHeight: number isFocused: boolean isScrolledDown: boolean - scrollElRef: any /* TODO */ + scrollElRef: React.MutableRefObject | null> } const FeedSection = React.forwardRef( function FeedSectionImpl(