@@ -123,7 +123,9 @@ const BottomSheetComponent = forwardRef<BottomSheetMethods, BottomSheetProps>(
123123 android_keyboardInputMode = DEFAULT_KEYBOARD_INPUT_MODE ,
124124
125125 // layout
126+ handleHeight : _providedHandleHeight ,
126127 containerHeight : _providedContainerHeight ,
128+ contentHeight : _providedContentHeight ,
127129 containerOffset : _providedContainerOffset ,
128130 topInset = 0 ,
129131 bottomInset = 0 ,
@@ -202,11 +204,13 @@ const BottomSheetComponent = forwardRef<BottomSheetMethods, BottomSheetProps>(
202204 const animatedContainerOffset = useReactiveSharedValue (
203205 _providedContainerOffset ?? INITIAL_CONTAINER_OFFSET
204206 ) as Animated . SharedValue < Insets > ;
205- const animatedHandleHeight = useReactiveSharedValue < number > (
206- INITIAL_HANDLE_HEIGHT
207+ const animatedHandleHeight = useReactiveSharedValue (
208+ _providedHandleHeight ?? INITIAL_HANDLE_HEIGHT
207209 ) ;
208210 const animatedFooterHeight = useSharedValue ( 0 ) ;
209- const animatedContentHeight = useSharedValue ( INITIAL_CONTAINER_HEIGHT ) ;
211+ const animatedContentHeight = useReactiveSharedValue (
212+ _providedContentHeight ?? INITIAL_CONTAINER_HEIGHT
213+ ) ;
210214 const [ animatedSnapPoints , animatedDynamicSnapPointIndex ] =
211215 useNormalizedSnapPoints (
212216 _providedSnapPoints ,
@@ -258,6 +262,14 @@ const BottomSheetComponent = forwardRef<BottomSheetMethods, BottomSheetProps>(
258262 }
259263
260264 let isHandleHeightCalculated = false ;
265+ // handle height is provided.
266+ if (
267+ _providedHandleHeight !== null &&
268+ _providedHandleHeight !== undefined &&
269+ typeof _providedHandleHeight === 'number'
270+ ) {
271+ isHandleHeightCalculated = true ;
272+ }
261273 // handle component is null.
262274 if ( handleComponent === null ) {
263275 animatedHandleHeight . value = 0 ;
@@ -281,9 +293,10 @@ const BottomSheetComponent = forwardRef<BottomSheetMethods, BottomSheetProps>(
281293 ) ;
282294 } , [
283295 _providedContainerHeight ,
284- animatedContainerHeight . value ,
296+ _providedHandleHeight ,
297+ animatedContainerHeight ,
285298 animatedHandleHeight ,
286- animatedSnapPoints . value ,
299+ animatedSnapPoints ,
287300 handleComponent ,
288301 ] ) ;
289302 const isInTemporaryPosition = useSharedValue ( false ) ;
@@ -1271,6 +1284,14 @@ const BottomSheetComponent = forwardRef<BottomSheetMethods, BottomSheetProps>(
12711284 [ _providedStyle , containerAnimatedStyle ]
12721285 ) ;
12731286 const contentContainerAnimatedStyle = useAnimatedStyle ( ( ) => {
1287+ /**
1288+ * if content height was provided, then we skip setting
1289+ * calculated height.
1290+ */
1291+ if ( _providedContentHeight ) {
1292+ return { } ;
1293+ }
1294+
12741295 /**
12751296 * if dynamic sizing is enabled, and content height
12761297 * is still not set, then we exit method.
@@ -1290,9 +1311,10 @@ const BottomSheetComponent = forwardRef<BottomSheetMethods, BottomSheetProps>(
12901311 } ;
12911312 } , [
12921313 enableDynamicSizing ,
1293- animatedContentHeight . value ,
1294- animatedContentHeightMax . value ,
1314+ animatedContentHeight ,
1315+ animatedContentHeightMax ,
12951316 _providedAnimationConfigs ,
1317+ _providedContentHeight ,
12961318 ] ) ;
12971319 const contentContainerStyle = useMemo (
12981320 ( ) => [ styles . contentContainer , contentContainerAnimatedStyle ] ,
0 commit comments