@@ -9,6 +9,7 @@ import ImageViewer from './ImageViewer';
99import Animated from 'react-native-reanimated' ;
1010import { SCREEN_WIDTH } from './constants' ;
1111import type { GalleryProps } from './Type' ;
12+ import { GestureHandlerRootView } from 'react-native-gesture-handler' ;
1213
1314function Gallery ( {
1415 data = [ ] ,
@@ -28,24 +29,26 @@ function Gallery({
2829 ) ;
2930
3031 return (
31- < View style = { [ styles . container , containerStyle ] } >
32- < Animated . FlatList
33- ref = { flatListRef }
34- data = { data }
35- renderItem = { renderItem }
36- horizontal
37- pagingEnabled
38- showsHorizontalScrollIndicator = { false }
39- bounces = { false }
40- getItemLayout = { ( _ , index ) => ( {
41- length : SCREEN_WIDTH ,
42- offset : SCREEN_WIDTH * index ,
43- index,
44- } ) }
45- style = { [ styles . container , { backgroundColor : backdropColor } , style ] }
46- contentContainerStyle = { contentContainerStyle }
47- />
48- </ View >
32+ < GestureHandlerRootView >
33+ < View style = { [ styles . container , containerStyle ] } >
34+ < Animated . FlatList
35+ ref = { flatListRef }
36+ data = { data }
37+ renderItem = { renderItem }
38+ horizontal
39+ pagingEnabled
40+ showsHorizontalScrollIndicator = { false }
41+ bounces = { false }
42+ getItemLayout = { ( _ , index ) => ( {
43+ length : SCREEN_WIDTH ,
44+ offset : SCREEN_WIDTH * index ,
45+ index,
46+ } ) }
47+ style = { [ styles . container , { backgroundColor : backdropColor } , style ] }
48+ contentContainerStyle = { contentContainerStyle }
49+ />
50+ </ View >
51+ </ GestureHandlerRootView >
4952 ) ;
5053}
5154
0 commit comments