Skip to content

Conversation

@anivar
Copy link

@anivar anivar commented Sep 4, 2025

Fixes #12742

Added dependency arrays to translateX and progress useDerivedValue hooks to prevent worklet recompilation on every render.

Tested on iOS and Android. No breaking changes.

Adds dependency arrays to useDerivedValue hooks to prevent worklet recompilation
on every render. This fixes performance issues with drawer animations, especially
on Android devices.

- Add dependencies to translateX calculation
- Add dependencies to progress calculation

These dependencies are required for React Native Reanimated v3 compatibility
and significantly improve drawer gesture performance.

Fixes react-navigation#12742
@github-actions
Copy link

github-actions bot commented Sep 4, 2025

Hey @anivar! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

@github-actions
Copy link

github-actions bot commented Sep 4, 2025

Hey @autofix-ci[bot]! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

@netlify
Copy link

netlify bot commented Sep 4, 2025

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit b55a249
🔍 Latest deploy log https://app.netlify.com/projects/react-navigation-example/deploys/68ba001d4cddc100088a8124
😎 Deploy Preview https://deploy-preview-12743--react-navigation-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Sep 4, 2025

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit 08c536b
🔍 Latest deploy log https://app.netlify.com/projects/react-navigation-example/deploys/68ba0047b04ef30008614c9b
😎 Deploy Preview https://deploy-preview-12743--react-navigation-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. The Reanimated babel plugin is supposed to add dependencies automatically, and they shouldn't be necessary to do it manually.

Reanimated docs say dependency array is only necessary when using without the Babel plugin on Web https://docs.swmansion.com/react-native-reanimated/docs/guides/web-support/#web-without-the-babel-plugin - and Reanimated is not used for the drawer on the web.

Can you provide repro and videos to verify the issue and the change? The text in the issue conflicts with Reanimated docs. Pull requests also need a test plan to ensure the that the changes can be tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing dependency arrays in useDerivedValue causing drawer performance issues

2 participants