55 BottomSheetModal ,
66 BottomSheetView ,
77 BottomSheetFooter ,
8- useBottomSheetDynamicSnapPoints ,
98} from '@gorhom/bottom-sheet' ;
109import { Button } from '../../components/button' ;
1110import { ContactItem } from '../../components/contactItem' ;
@@ -18,16 +17,9 @@ const DetachedExample = () => {
1817 const bottomSheetRef = useRef < BottomSheetModal > ( null ) ;
1918
2019 // variables
21- const initialSnapPoints = useMemo ( ( ) => [ 'CONTENT_HEIGHT' ] , [ ] ) ;
2220 const data = useMemo ( ( ) => createContactListMockData ( 2 ) , [ ] ) ;
2321
2422 // hooks
25- const {
26- animatedHandleHeight,
27- animatedSnapPoints,
28- animatedContentHeight,
29- handleContentLayout,
30- } = useBottomSheetDynamicSnapPoints ( initialSnapPoints ) ;
3123 const { bottom : safeBottomArea } = useSafeAreaInsets ( ) ;
3224
3325 // callbacks
@@ -73,9 +65,7 @@ const DetachedExample = () => {
7365 < Button label = "Close" onPress = { handleClosePress } />
7466 < BottomSheetModal
7567 ref = { bottomSheetRef }
76- snapPoints = { animatedSnapPoints }
77- handleHeight = { animatedHandleHeight }
78- contentHeight = { animatedContentHeight }
68+ enableDynamicSizing = { true }
7969 bottomInset = { safeBottomArea + 34 }
8070 enablePanDownToClose = { true }
8171 style = { styles . sheetContainer }
@@ -87,7 +77,6 @@ const DetachedExample = () => {
8777 < BottomSheetView
8878 style = { styles . contentContainerStyle }
8979 enableFooterMarginAdjustment = { true }
90- onLayout = { handleContentLayout }
9180 >
9281 { data . map ( renderItem ) }
9382 </ BottomSheetView >
0 commit comments