From affa0cf810ccc66f2e232f77e803428fb71b4c99 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 1 Mar 2026 07:30:43 +0000 Subject: [PATCH] =?UTF-8?q?Remove=20dead=20updateLayout=20JS=E2=86=92nativ?= =?UTF-8?q?e=20bridge=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that both platforms observe content height natively (iOS via KVO, Android via OnLayoutChangeListener), the JS-callable updateLayout() is unused. Remove: - updateLayout() and prevLayoutDetentIdentifier from iOS SheetView - AsyncFunction("updateLayout") from both platform module definitions - updateLayout method from the JS BottomSheetNativeComponent Android's updateLayout() is kept as a private implementation detail since the keyboard insets listener and native layout observer both call it internally. https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5 --- .../expo/modules/bottomsheet/BottomSheetModule.kt | 4 ---- modules/bottom-sheet/ios/BottomSheetModule.swift | 4 ---- modules/bottom-sheet/ios/SheetView.swift | 12 ------------ .../bottom-sheet/src/BottomSheetNativeComponent.tsx | 4 ---- 4 files changed, 24 deletions(-) diff --git a/modules/bottom-sheet/android/src/main/java/expo/modules/bottomsheet/BottomSheetModule.kt b/modules/bottom-sheet/android/src/main/java/expo/modules/bottomsheet/BottomSheetModule.kt index 6e3630d570..c6d8823b42 100644 --- a/modules/bottom-sheet/android/src/main/java/expo/modules/bottomsheet/BottomSheetModule.kt +++ b/modules/bottom-sheet/android/src/main/java/expo/modules/bottomsheet/BottomSheetModule.kt @@ -25,10 +25,6 @@ class BottomSheetModule : Module() { view.dismiss() } - AsyncFunction("updateLayout") { view: BottomSheetView -> - view.updateLayout() - } - Prop("disableDrag") { view: BottomSheetView, prop: Boolean -> view.disableDrag = prop } diff --git a/modules/bottom-sheet/ios/BottomSheetModule.swift b/modules/bottom-sheet/ios/BottomSheetModule.swift index 2269fbd910..ee0d180617 100644 --- a/modules/bottom-sheet/ios/BottomSheetModule.swift +++ b/modules/bottom-sheet/ios/BottomSheetModule.swift @@ -19,10 +19,6 @@ public class BottomSheetModule: Module { view.dismiss() } - AsyncFunction("updateLayout") { (view: SheetView) in - view.updateLayout() - } - Prop("cornerRadius") { (view: SheetView, prop: Float) in view.cornerRadius = CGFloat(prop) } diff --git a/modules/bottom-sheet/ios/SheetView.swift b/modules/bottom-sheet/ios/SheetView.swift index 320b58a5dd..2f38053125 100644 --- a/modules/bottom-sheet/ios/SheetView.swift +++ b/modules/bottom-sheet/ios/SheetView.swift @@ -71,7 +71,6 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate { } } } - private var prevLayoutDetentIdentifier: UISheetPresentationController.Detent.Identifier? // MARK: - Lifecycle @@ -186,17 +185,6 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate { } } - func updateLayout() { - // Allow updates either when identifiers match OR when prevLayoutDetentIdentifier is nil (first real content update) - if self.prevLayoutDetentIdentifier == self.selectedDetentIdentifier || self.prevLayoutDetentIdentifier == nil, - let contentHeight = self.innerView?.subviews.first?.frame.size.height { - self.sheetVc?.updateDetents(contentHeight: self.clampHeight(contentHeight), - preventExpansion: self.preventExpansion) - self.selectedDetentIdentifier = self.sheetVc?.getCurrentDetentIdentifier() - } - self.prevLayoutDetentIdentifier = self.selectedDetentIdentifier - } - func dismiss() { guard let sheetVc = self.sheetVc else { return diff --git a/modules/bottom-sheet/src/BottomSheetNativeComponent.tsx b/modules/bottom-sheet/src/BottomSheetNativeComponent.tsx index 0cba53f3b7..451ba6a388 100644 --- a/modules/bottom-sheet/src/BottomSheetNativeComponent.tsx +++ b/modules/bottom-sheet/src/BottomSheetNativeComponent.tsx @@ -71,10 +71,6 @@ export class BottomSheetNativeComponent extends React.Component< this.props.onStateChange?.(event) } - private updateLayout = () => { - this.ref.current?.updateLayout() - } - static dismissAll = async () => { await NativeModule.dismissAll() }