File tree Expand file tree Collapse file tree 6 files changed +32
-13
lines changed
packages/core/src/components Expand file tree Collapse file tree 6 files changed +32
-13
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
2- import { FlatList as FlatListstComponent } from "react-native" ;
2+ import {
3+ FlatList as FlatListComponent ,
4+ NativeViewGestureHandlerProps ,
5+ } from "react-native-gesture-handler" ;
36import type { FlatListProps } from "react-native" ;
47
5- const FlatList = React . forwardRef < FlatListstComponent , FlatListProps < any > > (
8+ const FlatList = React . forwardRef <
9+ FlatListComponent ,
10+ FlatListProps < any > & NativeViewGestureHandlerProps
11+ > (
612 < T extends any > (
7- { numColumns, ...rest } : FlatListProps < T > ,
8- ref : React . Ref < FlatListstComponent >
13+ { numColumns, ...rest } : FlatListProps < T > & NativeViewGestureHandlerProps ,
14+ ref : React . Ref < FlatListComponent >
915 ) => {
1016 return (
11- < FlatListstComponent
17+ < FlatListComponent
1218 key = { numColumns } // Changing numColumns requires re-rendering, setting it as the key ensures list is re-rendered when it changes
1319 numColumns = { numColumns }
1420 ref = { ref }
Original file line number Diff line number Diff line change 11import React from "react" ;
22import { FlashListProps , FlashList } from "@shopify/flash-list" ;
3- import { FlatListProps , FlatList as FlatListComponent } from "react-native" ;
3+ import { FlatListProps } from "react-native" ;
4+ import {
5+ FlatList as FlatListComponent ,
6+ NativeViewGestureHandlerProps ,
7+ } from "react-native-gesture-handler" ;
48import SectionHeader , { DefaultSectionHeader } from "./SectionHeader" ;
59import { flattenReactFragments } from "../../utilities" ;
610import FlatList from "../FlatList" ;
@@ -192,7 +196,8 @@ const SectionList = React.forwardRef(
192196 < FlatList
193197 ref = { ref as React . Ref < FlatListComponent > }
194198 stickyHeaderIndices = { sectionHeaderIndicies }
195- { ...( rest as FlatListProps < SectionListItem < T > > ) }
199+ { ...( rest as FlatListProps < SectionListItem < T > > &
200+ NativeViewGestureHandlerProps ) }
196201 data = { dataWithSections }
197202 renderItem = { renderItem }
198203 keyExtractor = { keyExtractor }
Original file line number Diff line number Diff line change 11import React from "react" ;
22import FlatList from "../FlatList" ;
3- import { FlatList as FlatListComponent } from "react-native" ;
3+ import {
4+ FlatList as FlatListComponent ,
5+ NativeViewGestureHandlerProps ,
6+ } from "react-native-gesture-handler" ;
47import type { FlatListProps } from "react-native" ;
58import useSplitContentContainerStyles from "./useSplitContentContainerStyles" ;
69
@@ -14,7 +17,8 @@ const SimpleStyleFlatList = React.forwardRef(
1417 style : styleProp ,
1518 data,
1619 ...rest
17- } : Omit < FlatListProps < T > , "contentContainerStyle" > ,
20+ } : Omit < FlatListProps < T > , "contentContainerStyle" > &
21+ NativeViewGestureHandlerProps ,
1822 ref : React . Ref < FlatListComponent >
1923 ) => {
2024 const { style, contentContainerStyle } =
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import type {
55 FlashListSectionListProps ,
66} from "../SectionList" ;
77import useSplitContentContainerStyles from "./useSplitContentContainerStyles" ;
8- import { FlatList } from "react-native" ;
8+ import { FlatList } from "react-native-gesture-handler " ;
99import { FlashList } from "@shopify/flash-list" ;
1010
1111/**
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import type {
55 FlatListSwipeableListProps ,
66} from "../SwipeableItem" ;
77import useSplitContentContainerStyles from "./useSplitContentContainerStyles" ;
8- import { FlatList } from "react-native" ;
8+ import { FlatList } from "react-native-gesture-handler " ;
99import { FlashList } from "@shopify/flash-list" ;
1010
1111/**
Original file line number Diff line number Diff line change 11import React from "react" ;
22import { FlashListProps , FlashList } from "@shopify/flash-list" ;
3- import { FlatListProps , FlatList as FlatListComponent } from "react-native" ;
3+ import { FlatListProps } from "react-native" ;
4+ import {
5+ FlatList as FlatListComponent ,
6+ NativeViewGestureHandlerProps ,
7+ } from "react-native-gesture-handler" ;
48import FlatList from "../FlatList" ;
59
610type ListComponentType = "FlatList" | "FlashList" ;
@@ -54,7 +58,7 @@ const SwipeableList = React.forwardRef(
5458 return (
5559 < FlatList
5660 ref = { ref as React . Ref < FlatListComponent > }
57- { ...( rest as FlatListProps < T > ) }
61+ { ...( rest as FlatListProps < T > & NativeViewGestureHandlerProps ) }
5862 />
5963 ) ;
6064 case "FlashList" :
You can’t perform that action at this time.
0 commit comments