Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 3 additions & 8 deletions src/components/bottomSheet/BottomSheetContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { memo, useMemo } from 'react';
import type { ViewProps, ViewStyle } from 'react-native';
import Animated, {
import {
type AnimatedStyle,
useAnimatedStyle,
useDerivedValue,
Expand All @@ -14,7 +14,6 @@ import { useBottomSheetInternal } from '../../hooks';
import type { NullableAccessibilityProps } from '../../types';
import { animate } from '../../utilities';
import BottomSheetDraggableView from '../bottomSheetDraggableView';
import {} from './constants';
import type { BottomSheetProps } from './types';

type BottomSheetContent = {
Expand Down Expand Up @@ -45,7 +44,6 @@ function BottomSheetContentComponent({
const {
enableDynamicSizing,
overDragResistanceFactor,
enableContentPanningGesture,
animatedPosition,
animatedLayoutState,
animatedDetentsState,
Expand Down Expand Up @@ -234,19 +232,16 @@ function BottomSheetContentComponent({
//#endregion

//#region render
const DraggableView = enableContentPanningGesture
? BottomSheetDraggableView
: Animated.View;
return (
<DraggableView
<BottomSheetDraggableView
accessible={accessible}
accessibilityLabel={accessibilityLabel}
accessibilityHint={accessibilityHint}
accessibilityRole={accessibilityRole}
style={contentContainerStyle}
>
{children}
</DraggableView>
</BottomSheetDraggableView>
);
//#endregion
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, memo } from 'react';
import React, { memo, useMemo } from 'react';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';
import { BottomSheetDraggableContext } from '../../contexts/gesture';
Expand Down Expand Up @@ -108,7 +108,9 @@ const BottomSheetDraggableViewComponent = ({

return (
<GestureDetector gesture={draggableGesture}>
<BottomSheetDraggableContext.Provider value={draggableGesture}>
<BottomSheetDraggableContext.Provider
value={enableContentPanningGesture ? draggableGesture : null}
>
<Animated.View style={style} {...rest}>
{children}
</Animated.View>
Expand Down