From 72b09d2737b040ea9a3b5ba2e04acbfe69ecc7f1 Mon Sep 17 00:00:00 2001 From: bradreelee Date: Thu, 20 Aug 2026 22:32:14 +0900 Subject: [PATCH] fix: apply every entry of a content container style array `useBottomSheetContentContainerStyle` folded array styles with `StyleSheet.compose(..._style)`, but `composeStyles(style1, style2)` accepts exactly two arguments and silently drops the rest. Any array of three or more entries passed to `BottomSheetView`'s `style` or a scrollable's `contentContainerStyle` lost everything from the third entry on, with no error or warning. The same call is also why the name is misleading: `compose` returns `[a, b]` rather than a merged object, so the `enableFooterMarginAdjustment` branch below destructures `paddingBottom` / `padding` / `paddingVertical` off an array and always reads `undefined`. The caller's bottom padding is then replaced by `0 + footerHeight`. `StyleSheet.flatten` handles arrays of any length and depth and returns a real object, which fixes both and lets the `@ts-ignore` go. Closes #2383 --- src/hooks/useBottomSheetContentContainerStyle.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/hooks/useBottomSheetContentContainerStyle.ts b/src/hooks/useBottomSheetContentContainerStyle.ts index 6c0bffe1..aeb73723 100644 --- a/src/hooks/useBottomSheetContentContainerStyle.ts +++ b/src/hooks/useBottomSheetContentContainerStyle.ts @@ -19,12 +19,7 @@ export function useBottomSheetContentContainerStyle( //#region styles const flattenStyle = useMemo(() => { - return !_style - ? {} - : Array.isArray(_style) - ? // @ts-ignore - (StyleSheet.compose(..._style) as ViewStyle) - : (_style as ViewStyle); + return _style ? StyleSheet.flatten(_style) : {}; }, [_style]); const style = useMemo(() => { if (!enableFooterMarginAdjustment) {