diff --git a/packages/app/src/components/ui/isolated-bottom-sheet-modal/index.test.tsx b/packages/app/src/components/ui/isolated-bottom-sheet-modal/index.test.tsx index 9c0bc0193c..1de2dd8f84 100644 --- a/packages/app/src/components/ui/isolated-bottom-sheet-modal/index.test.tsx +++ b/packages/app/src/components/ui/isolated-bottom-sheet-modal/index.test.tsx @@ -335,15 +335,21 @@ describe("IsolatedBottomSheetModal content drag", () => { ); }); -// Exercise the library boundary as well as the modal props: nested refs used to be silently dropped. -import BottomSheetDraggableView from "@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView"; -import { BottomSheetInternalContext } from "@gorhom/bottom-sheet/src/contexts/internal"; -import { - BottomSheetDraggableContext, - BottomSheetGestureHandlersContext, -} from "@gorhom/bottom-sheet/src/contexts/gesture"; -import { Gesture } from "react-native-gesture-handler"; -import { extractGestureRelations } from "react-native-gesture-handler/src/handlers/gestures/GestureDetector/utils"; +// Load the real vendored implementations at runtime without typechecking Gorhom's entire source +// tree (its hooks barrel reaches upstream files that don't compile under the app's TS settings). +const gorhomSource = "@gorhom/bottom-sheet/src"; +const { default: BottomSheetDraggableView } = await import( + `${gorhomSource}/components/bottomSheetDraggableView/BottomSheetDraggableView` +); +const { BottomSheetInternalContext } = await import(`${gorhomSource}/contexts/internal`); +const { BottomSheetDraggableContext, BottomSheetGestureHandlersContext } = await import( + `${gorhomSource}/contexts/gesture` +); +const rnghSource = "react-native-gesture-handler/src"; +const { extractGestureRelations } = await import( + `${rnghSource}/handlers/gestures/GestureDetector/utils` +); +import { Gesture, type GestureType } from "react-native-gesture-handler"; const noGestureWork = () => {}; const gestureHandlerContext = { @@ -365,7 +371,7 @@ function dragInternalContext(relations: SheetContentDragGesture | SheetContentDr enableContentPanningGesture: true, waitFor: relations, simultaneousHandlers: relations, - } as React.ContextType; + }; } describe("bottom sheet native drag relations", () => { @@ -381,7 +387,7 @@ describe("bottom sheet native drag relations", () => { let resolved: ReturnType | undefined; const internal = dragInternalContext(relations); function Probe() { - const pan = useContext(BottomSheetDraggableContext); + const pan = useContext(BottomSheetDraggableContext) as GestureType | null; if (pan) resolved = extractGestureRelations(pan); return null; } diff --git a/patches/@gorhom+bottom-sheet+5.2.14.patch b/patches/@gorhom+bottom-sheet+5.2.14.patch index c42d874a9f..7943d4cb19 100644 --- a/patches/@gorhom+bottom-sheet+5.2.14.patch +++ b/patches/@gorhom+bottom-sheet+5.2.14.patch @@ -196,6 +196,19 @@ index 8259637..eb057fe 100644 export { useScrollEventsHandlersDefault } from './hooks/useScrollEventsHandlersDefault'; export { useGestureEventsHandlersDefault } from './hooks/useGestureEventsHandlersDefault'; export { useBottomSheetGestureHandlers } from './hooks/useBottomSheetGestureHandlers'; +diff --git a/node_modules/@gorhom/bottom-sheet/lib/typescript/components/bottomSheet/types.d.ts b/node_modules/@gorhom/bottom-sheet/lib/typescript/components/bottomSheet/types.d.ts +index 6b23056..8d92aae 100644 +--- a/node_modules/@gorhom/bottom-sheet/lib/typescript/components/bottomSheet/types.d.ts ++++ b/node_modules/@gorhom/bottom-sheet/lib/typescript/components/bottomSheet/types.d.ts +@@ -353,6 +353,6 @@ export type BottomSheetGestureProps = { + + simultaneousHandlers: Parameters< + PanGesture['simultaneousWithExternalGesture'] +- >[0]; +- waitFor: Parameters[0]; ++ >[0] | Parameters; ++ waitFor: Parameters[0] | Parameters; + }; diff --git a/node_modules/@gorhom/bottom-sheet/lib/typescript/index.d.ts b/node_modules/@gorhom/bottom-sheet/lib/typescript/index.d.ts index ffc6caa..550f1b3 100644 --- a/node_modules/@gorhom/bottom-sheet/lib/typescript/index.d.ts @@ -209,8 +222,21 @@ index ffc6caa..550f1b3 100644 export { useScrollEventsHandlersDefault } from './hooks/useScrollEventsHandlersDefault'; export { useGestureEventsHandlersDefault } from './hooks/useGestureEventsHandlersDefault'; export { useBottomSheetGestureHandlers } from './hooks/useBottomSheetGestureHandlers'; +diff --git a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheet/types.d.ts b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheet/types.d.ts +index 6b23056..8d92aae 100644 +--- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheet/types.d.ts ++++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheet/types.d.ts +@@ -353,6 +353,6 @@ export type BottomSheetGestureProps = { + + simultaneousHandlers: Parameters< + PanGesture['simultaneousWithExternalGesture'] +- >[0]; +- waitFor: Parameters[0]; ++ >[0] | Parameters; ++ waitFor: Parameters[0] | Parameters; + }; diff --git a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx -index 923e430..5f68852 100644 +index 923e430..eeef8cf 100644 --- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx +++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx @@ -65,12 +65,12 @@ const BottomSheetDraggableViewComponent = ({ @@ -224,12 +250,12 @@ index 923e430..5f68852 100644 if (simultaneousHandlers) { gesture = gesture.simultaneousWithExternalGesture( - simultaneousHandlers as never -+ ...simultaneousHandlers ++ ...(simultaneousHandlers as Parameters) ); } diff --git a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetHandle/BottomSheetHandleContainer.tsx b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetHandle/BottomSheetHandleContainer.tsx -index 0223843..c72196f 100644 +index 0223843..4ca56e5 100644 --- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetHandle/BottomSheetHandleContainer.tsx +++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetHandle/BottomSheetHandleContainer.tsx @@ -67,12 +67,12 @@ function BottomSheetHandleContainerComponent({ @@ -243,7 +269,7 @@ index 0223843..c72196f 100644 if (simultaneousHandlers) { gesture = gesture.simultaneousWithExternalGesture( - simultaneousHandlers as never -+ ...simultaneousHandlers ++ ...(simultaneousHandlers as Parameters) ); }