Skip to content

Commit

Permalink
fix: updated typings for sectionlist to mirror rn core types (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak committed Jun 2, 2021
1 parent d9b417f commit dd9dbdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { memo } from 'react';
import {
DefaultSectionT,
SectionList as RNSectionList,
SectionListProps as RNSectionListProps,
} from 'react-native';
Expand All @@ -16,12 +17,12 @@ const AnimatedSectionList =
const BottomSheetSectionListComponent =
createBottomSheetScrollableComponent<
BottomSheetSectionListMethods,
BottomSheetSectionListProps<any>
BottomSheetSectionListProps<any, DefaultSectionT>
>(AnimatedSectionList);

const BottomSheetSectionList = memo(BottomSheetSectionListComponent);
BottomSheetSectionList.displayName = 'BottomSheetSectionList';

export default BottomSheetSectionList as <T>(
props: BottomSheetSectionListProps<T>
export default BottomSheetSectionList as <ItemT, SectionT = DefaultSectionT>(
props: BottomSheetSectionListProps<ItemT, SectionT>
) => ReturnType<typeof BottomSheetSectionList>;
4 changes: 2 additions & 2 deletions src/components/bottomSheetScrollable/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export interface BottomSheetScrollViewMethods {
//#endregion

//#region SectionList
type BottomSheetSectionListProps<T> = Omit<
Animated.AnimateProps<SectionListProps<T>>,
type BottomSheetSectionListProps<ItemT, SectionT> = Omit<
Animated.AnimateProps<SectionListProps<ItemT, SectionT>>,
'decelerationRate' | 'onScrollBeginDrag' | 'scrollEventThrottle'
> &
BottomSheetScrollableProps & {
Expand Down

0 comments on commit dd9dbdc

Please sign in to comment.