Skip to content

Commit

Permalink
fix #483: remove ListFooterComponent and ListHeaderComponent from Pro…
Browse files Browse the repository at this point in the history
…psProvider
  • Loading branch information
Noah Cardoza committed Jun 21, 2023
1 parent ebfddc4 commit 4bccedd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/DraggableFlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,20 +402,21 @@ function DraggableFlatListInner<T>(props: DraggableFlatListProps<T>) {
}

function DraggableFlatList<T>(
props: DraggableFlatListProps<T>,
{ListFooterComponent, ListHeaderComponent, ...props}: DraggableFlatListProps<T>,
ref?: React.ForwardedRef<FlatList<T>> | null
) {
return (
<PropsProvider {...props}>
<AnimatedValueProvider>
<RefProvider flatListRef={ref}>
<MemoizedInner {...props} />
<MemoizedInner {...props} ListFooterComponent={ListFooterComponent} ListHeaderComponent={ListHeaderComponent} />
</RefProvider>
</AnimatedValueProvider>
</PropsProvider>
);
}


const MemoizedInner = typedMemo(DraggableFlatListInner);

// Generic forwarded ref type assertion taken from:
Expand Down

0 comments on commit 4bccedd

Please sign in to comment.