Skip to content

fix: omit native scroll handler dependencies - #2759

Open
huytdps13400 wants to merge 1 commit into
gorhom:masterfrom
huytdps13400:fix/2758-native-scroll-handler-dependencies
Open

fix: omit native scroll handler dependencies#2759
huytdps13400 wants to merge 1 commit into
gorhom:masterfrom
huytdps13400:fix/2758-native-scroll-handler-dependencies

Conversation

@huytdps13400

Copy link
Copy Markdown

Motivation

Fixes #2758.

Reanimated 4.6 warns whenever native useAnimatedScrollHandler receives a dependency array because that argument is only intended for web builds without the Worklets Babel plugin. Bottom Sheet already resolves useScrollHandler.web.ts on web, so useScrollHandler.ts is the native implementation and does not need the second argument.

This removes only the native dependency array. The handler closures and existing platform-specific web implementation remain unchanged.

Verification

  • TDD regression: the TypeScript-AST contract test failed with native argument count 2, then passed with 1
  • yarn test — 1 passed
  • yarn typescript — passed
  • yarn build — CommonJS, module, and declarations passed; built native output calls useAnimatedScrollHandler with one argument
  • Biome check for all changed files — passed

The repository-wide yarn lint command still reports one existing warning in unchanged src/hooks/useBoundingClientRect.ts:54 (useOptionalChain); this PR adds no lint findings.

I intentionally did not migrate the existing runOnJS calls here: the package still supports Reanimated 3 and does not declare react-native-worklets as a peer, so that compatibility migration is separate from this warning-only fix.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: BottomSheetScrollView triggers Reanimated 4.6.0 native dependency warning

1 participant