Skip to content

Commit 60ca41a

Browse files
committed
use animated value for isAtEdge
1 parent 45e6cc5 commit 60ca41a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ function InfinitePager(
293293
}, [curIndex, maxIndex]);
294294

295295
const isAtEdge = isMinIndex || isMaxIndex;
296+
const isAtEdgeAnim = useDerivedValue(() => {
297+
return isAtEdge;
298+
}, [isAtEdge]);
296299

297300
const initTouchX = useSharedValue(0);
298301
const initTouchY = useSharedValue(0);
@@ -313,7 +316,7 @@ function InfinitePager(
313316
panGesture
314317
.onBegin((evt) => {
315318
"worklet";
316-
if (!isAtEdge) {
319+
if (!isAtEdgeAnim.value) {
317320
const updated = activePagers.value.slice();
318321
updated.push(pagerId);
319322
activePagers.value = updated;

0 commit comments

Comments
 (0)