Skip to content

fix: useHandler not working on web without babel plugin#8883

Open
MatiPl01 wants to merge 6 commits intomainfrom
@maipl01/fix-useHandler-no-worklet-support
Open

fix: useHandler not working on web without babel plugin#8883
MatiPl01 wants to merge 6 commits intomainfrom
@maipl01/fix-useHandler-no-worklet-support

Conversation

@MatiPl01
Copy link
Member

@MatiPl01 MatiPl01 commented Jan 28, 2026

Summary

This PR adjusts the implementation of the useHandler to work when non-worklet functions are passed. It removes the always-crash behavior for non-worklet functions I introduced in #7604

Old behavior:

  • Always crash when at least one non-worklet handler function is provided.

New behavior:

  • On web: Crash only when at least one non-worklet function is provided and no explicit hook dependencies are passed (we cannot get worklet hash of non-worklet function so we don't know when it changes),
  • On other platforms: Allow only worklet functions, crash in all cases if non-worklets are provided. Dependencies don't have to be passed. When passed, they are only used as additional re-render trigger apart from worklets (which change when their closures change, etc.)

@MatiPl01 MatiPl01 self-assigned this Jan 28, 2026
@MatiPl01 MatiPl01 linked an issue Jan 28, 2026 that may be closed by this pull request
@MatiPl01 MatiPl01 force-pushed the @maipl01/worklet-mock branch from bd02322 to 9812a3e Compare January 28, 2026 23:55
@MatiPl01 MatiPl01 force-pushed the @maipl01/fix-useHandler-no-worklet-support branch from dbb2f20 to 1b3d02d Compare January 29, 2026 00:57
@MatiPl01 MatiPl01 requested a review from tjzel January 29, 2026 00:58
Base automatically changed from @maipl01/worklet-mock to main January 29, 2026 11:02
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.

useHandler doesn't support web without babel plugin

2 participants