Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/components/DraggableList/index.android.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import React from 'react';
import {View} from 'react-native';
import DraggableFlatList from 'react-native-draggable-flatlist';
import type {FlatList} from 'react-native-gesture-handler';
import {NestableDraggableFlatList, NestableScrollContainer} from 'react-native-draggable-flatlist';
import type {ScrollView} from 'react-native-gesture-handler';
import useThemeStyles from '@hooks/useThemeStyles';
import type {DraggableListProps} from './types';

function DraggableList<T>({renderClone, shouldUsePortal, ListFooterComponent, ...viewProps}: DraggableListProps<T>, ref: React.ForwardedRef<FlatList<T>>) {
function DraggableList<T>({renderClone, shouldUsePortal, ListFooterComponent, ...viewProps}: DraggableListProps<T>, ref: React.ForwardedRef<ScrollView>) {
const styles = useThemeStyles();
return (
<View style={styles.flex1}>
<DraggableFlatList
ref={ref}
containerStyle={ListFooterComponent ? undefined : styles.flex1}
contentContainerStyle={ListFooterComponent ? undefined : styles.flexGrow1}
<NestableScrollContainer
ref={ref}
contentContainerStyle={styles.flexGrow1}
>
<NestableDraggableFlatList
contentContainerStyle={styles.flex1}
// eslint-disable-next-line react/jsx-props-no-spreading
{...viewProps}
/>
{React.isValidElement(ListFooterComponent) && <View style={styles.flexGrow1}>{ListFooterComponent}</View>}
</View>
</NestableScrollContainer>
);
}

Expand Down