Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] None of the callbacks in the gesture are worklets - warning by gesture handler #44

Closed
fobos531 opened this issue Sep 8, 2024 · 3 comments · Fixed by #47
Closed
Assignees
Labels
bug Something isn't working

Comments

@fobos531
Copy link

fobos531 commented Sep 8, 2024

Thank you for the awesome library!

Describe the bug

It is basically the same issue as this: dohooo/react-native-reanimated-carousel#654

To Reproduce
Steps to reproduce the behavior:

  1. Render a simple toast.

Expected behavior

The warning should not appear.

Screenshots

CleanShot 2024-09-08 at 19 09 04@2x

Environment info

Library Version
sonner-native 0.7.0
react-native 0.75.2
react-native-reanimated 3.15.1
react-native-gesture-handler 2.19.0

Additional context

Based on the discussion in the linked issue, and this link: https://docs.swmansion.com/react-native-gesture-handler/docs/#automatic-workletization-of-gesture-callbacks

this should already work based on how you defined the gesture, so I'm not sure why the callbacks are not being automatically workletized. You may need to use a workaround similar to this one: dohooo/react-native-reanimated-carousel#577

@fobos531 fobos531 added the bug Something isn't working label Sep 8, 2024
@gunnartorfis
Copy link
Owner

Hmmm. I haven't seen this warning myself.

Could you try to downgrade react-native-gesture-handler and see if the warning goes away? I'm personally running 2.16.2.

@hyoban
Copy link
Collaborator

hyoban commented Sep 9, 2024

I have the same problem with 2.19.0, 2.16.2 works fine for me.

@matinzd
Copy link
Contributor

matinzd commented Sep 9, 2024

Hey!

You need to define 'worklet' explicitly in order for tasks to run on the UI thread. That is a valid warning and it shows that those callbacks are not being run on the UI thread.

Here is the fix:

#47

This change was introduced in this PR:

software-mansion/react-native-gesture-handler#2901

And this release:

https://github.com/software-mansion/react-native-gesture-handler/releases/tag/2.17.0

I am still not sure this was the goal after refactoring but it this warning started from those changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants