Make iOS-unreliable state Android-only

We didn't really need the only existing xplat usage of it (but it *was* causing bugs).
This commit is contained in:
Dan Abramov
2024-11-03 02:09:30 +00:00
parent 01b350175e
commit 5743c4d148
4 changed files with 16 additions and 12 deletions
@@ -44,7 +44,7 @@ type Props = {
onRequestClose: () => void
onTap: () => void
onZoom: (isZoomed: boolean) => void
isScrollViewBeingDragged: boolean
isPagingAndroid: boolean
showControls: boolean
dismissSwipePan: PanGesture
}
@@ -52,7 +52,7 @@ const ImageItem = ({
imageSrc,
onTap,
onZoom,
isScrollViewBeingDragged,
isPagingAndroid,
dismissSwipePan,
}: Props) => {
const [isScaled, setIsScaled] = useState(false)
@@ -282,7 +282,7 @@ const ImageItem = ({
committedTransform.value = withClampedSpring(finalTransform)
})
const composedGesture = isScrollViewBeingDragged
const composedGesture = isPagingAndroid
? // If the parent is not at rest, provide a no-op gesture.
Gesture.Manual()
: Gesture.Exclusive(
@@ -29,7 +29,7 @@ type Props = {
onRequestClose: () => void
onTap: () => void
onZoom: (scaled: boolean) => void
isScrollViewBeingDragged: boolean
isPagingAndroid: boolean // Not available on iOS
showControls: boolean
dismissSwipePan: PanGesture | null
}
@@ -11,7 +11,7 @@ type Props = {
onRequestClose: () => void
onTap: () => void
onZoom: (scaled: boolean) => void
isScrollViewBeingDragged: boolean
isPagingAndroid: boolean
showControls: boolean
dismissSwipePan: PanGesture | null
}