Skip to content

fix: ensure useOnProgressChange responds to new offsetX and sizeReady…#905

Closed
gdvsbp wants to merge 2 commits into
dohooo:mainfrom
gdvsbp:patch-1
Closed

fix: ensure useOnProgressChange responds to new offsetX and sizeReady…#905
gdvsbp wants to merge 2 commits into
dohooo:mainfrom
gdvsbp:patch-1

Conversation

@gdvsbp

@gdvsbp gdvsbp commented Mar 14, 2026

Copy link
Copy Markdown

… instances

Description

useOnProgressChange will not re-run useAnimatedReaction if new SharedValue instances of offsetX or sizeReady are passed as options because they do not exist in useAnimatedReaction's dependency array.

image

Ran into this issue at work and patched it in our project so I wanted to contribute the same fix back to the project.

Review

  • I self-reviewed this PR

Testing

  • I added/updated tests
  • I manually tested

Saw onProgressChange called with updated values when given new instances of shared values were passed

@changeset-bot

changeset-bot Bot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5eddf43

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-native-reanimated-carousel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Mar 14, 2026

Copy link
Copy Markdown

@gdvsbp is attempting to deploy a commit to the Caspian's Team Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Mar 14, 2026
… 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.
@gdvsbp gdvsbp marked this pull request as draft March 14, 2026 17:00
@gdvsbp

gdvsbp commented Mar 14, 2026

Copy link
Copy Markdown
Author

Closing in favor of #906 which goes against 4.x.x instead of main

@gdvsbp gdvsbp closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants