diff --git a/package.json b/package.json index 9cb7149..91f1be5 100644 --- a/package.json +++ b/package.json @@ -72,5 +72,6 @@ "publishConfig": { "access": "public" }, - "repository": "https://github.com/strvcom/react-native-hero-carousel" + "repository": "https://github.com/strvcom/react-native-hero-carousel", + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/src/components/SlideAnimatedView/index.tsx b/src/components/SlideAnimatedView/index.tsx index 0572b99..ef701b0 100644 --- a/src/components/SlideAnimatedView/index.tsx +++ b/src/components/SlideAnimatedView/index.tsx @@ -17,6 +17,7 @@ type SlideAnimatedViewProps = { enteringThreshold?: number exitingThreshold?: number style?: AnimatedProps['style'] + keepVisibleAfterExiting?: boolean } export const SlideAnimatedView = ({ @@ -26,6 +27,7 @@ export const SlideAnimatedView = ({ layout, enteringThreshold = 0.99, exitingThreshold = 0.01, + keepVisibleAfterExiting = false, style, }: SlideAnimatedViewProps) => { const { index, total } = useAutoCarouselSlideIndex() @@ -56,6 +58,9 @@ export const SlideAnimatedView = ({ currentValue <= exitingThreshold && (previousValue === null || previousValue > exitingThreshold) ) { + if (keepVisibleAfterExiting) { + return + } runOnJS(setShouldShow)(false) } },