You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation seems to be out of step with the api, suggesting that onProgressChange={progress} will work when progress is defined as const progress = useSharedValue<number>(0);
When I implemented this my IDE complained about a typescript error and the app crashed with an error from reanimated.
What I am observing is that onProgressChange needs a callback with the following function signature.
Hey @nzcodarnoc! I'm here to help you with any software bugs, questions, or contributions. Let's tackle this together!
The feedback is correct. The documentation for "Parallax" in "react-native-reanimated-carousel 3.5.1" incorrectly suggests using onProgressChange={progress}. The onProgressChange prop requires a callback function, not a shared value. The correct usage involves passing a function like handleProgressChange with the signature:
(value: number,absoluteProgress: number)=>void
This function updates the shared values for progress, as you've described [1][2].
The documentation seems to be out of step with the api, suggesting that
onProgressChange={progress}
will work when progress is defined asconst progress = useSharedValue<number>(0);
When I implemented this my IDE complained about a typescript error and the app crashed with an error from reanimated.
What I am observing is that onProgressChange needs a callback with the following function signature.
So that the prop in question is now
onProgressChange={handleProgressChange}
For
react-native-reanimated-carousel 3.5.1
The text was updated successfully, but these errors were encountered: