Skip to content

fix: reanimated 3.0 compatibility - #1596

Merged
kirillzyusko merged 2 commits into
mainfrom
fix/rea-3.0-support
Aug 11, 2026
Merged

fix: reanimated 3.0 compatibility#1596
kirillzyusko merged 2 commits into
mainfrom
fix/rea-3.0-support

Conversation

@kirillzyusko

@kirillzyusko kirillzyusko commented Aug 10, 2026

Copy link
Copy Markdown
Owner

📜 Description

Fixed package compatibility for reanimated version lower than 3.7.0

💡 Motivation and Context

On Reanimated 3.7.0- the useEvent handler returns ref (with current property). After reanimated 3.8.0 it returns an object that contains workletEventHandler. Somehow in #1209 I thought that it returns the event handler directly (not in ref). So I declared the object as object-or-direct-handler.

In #1585 (comment) I realized that I made a mistake, so in this PR I eliminated a dead code and fixed compatibility.

Follow up for #1209 (something that had to be implemented there from the beginning).

Closes #1585 (comment)

📢 Changelog

JS

  • rename WorkletHandlerOrWorkletHandlerObject to WorkletHandlerContainer;
  • replace currentHandler.* with currentHandler.current.*;
  • updated titles of unit tests;

🤔 How Has This Been Tested?

Tested via this PR (e2e tests).

📸 Screenshots (if appropriate):

image

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Aug 10, 2026
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working tests You added or changed unit tests labels Aug 10, 2026
@kirillzyusko

Copy link
Copy Markdown
Owner Author

Hey @ahulterstrom 👋

Could you please confirm that these changes fix a problem 2 described in #1585 (comment)? 🙏

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
334397 bytes 334380 bytes 17 bytes 📈

@kirillzyusko
kirillzyusko marked this pull request as ready for review August 11, 2026 08:25
@github-actions

Copy link
Copy Markdown
Contributor
  1. Runtime error when passing direct WorkletHandler
    Why: The code incorrectly assumes all handlers are either wrapped with 'current' or 'workletEventHandler'. Passing a direct WorkletHandler leads to accessing undefined properties, causing crashes.
    Fix: Ensure the code handles both wrapped and unwrapped handler types correctly.

  2. Type mismatches in handler processing
    Why: Changes to WorkletHandlerContainer type may cause TypeScript to misinterpret handler structures, leading to incorrect method calls and potential runtime errors.
    Fix: Review and adjust type definitions to properly accommodate all valid handler formats.

LGTM

@kirillzyusko
kirillzyusko merged commit 55b317b into main Aug 11, 2026
18 checks passed
@kirillzyusko
kirillzyusko deleted the fix/rea-3.0-support branch August 11, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working tests You added or changed unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] compileReleaseKotlin fails on RN < 0.74 since 1.21.0: Unresolved reference ClippingScrollViewDecoratorViewManager (wrong package declaration)

1 participant