Skip to content

Commit 5eddf43

Browse files
committed
fix: ensure useOnProgressChange responds to new offsetX and sizeReady instances
Passing new offsetX or sizeReady instances to useOnProgressChange hook would not cause useAnimatedReaction hook to re-run despite it using those values. Adding those two shared values as dependencies of the hook.
1 parent 43a4c08 commit 5eddf43

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/cyan-points-wash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-native-reanimated-carousel": patch
3+
---
4+
5+
Adding `offsetX`/`sizeReady` as internal dependencies of useOnProgressChange to ensure reactivity

src/hooks/useOnProgressChange.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ export function useOnProgressChange(
4545
else onProgressChange.value = absoluteProgress;
4646
}
4747
},
48-
[loop, autoFillData, rawDataLength, onProgressChange, size]
48+
[loop, autoFillData, rawDataLength, onProgressChange, size, offsetX, sizeReady]
4949
);
5050
}

0 commit comments

Comments
 (0)