-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
None of the callbacks in the gesture are worklets. #654
Comments
To resolve the warning message, you need to ensure that the functions used within the Reanimated worklets are properly marked as worklets or are wrapped with Here's an example of how to correctly use import { Gesture, GestureDetector } from 'react-native-gesture-handler';
import { runOnJS } from 'react-native-reanimated';
const gesture = Gesture.Pan()
.onUpdate((event) => {
'worklet';
// Your worklet code here
})
.onEnd((event) => {
'worklet';
runOnJS(onGestureEnd)(event);
});
const onGestureEnd = (event) => {
// Your JS thread code here
};
<GestureDetector gesture={gesture}>
{/* Your carousel component */}
</GestureDetector> In this example, the Additionally, ensure that your project is using compatible versions of If you follow these steps, the warning should be resolved. |
Does this PR appear to resolve this? 🙏 |
not totally sure, maybe? how does https://docs.swmansion.com/react-native-gesture-handler/docs/#automatic-workletization-of-gesture-callbacks relate to all this? |
yeah! In #577, see "Discussion of the bug" / "But why doesn't the |
Same issue here! Is there any workaround for the moment? |
+1 |
1 similar comment
+1 |
I think this should be fixed with which was released in v4.0.0-canary.13 (and included in releases thereafter) |
+1 to the issue described above. @nmassey, it is certainly possible I did something improper. However, I thought I would share that after installing Cheers. |
Hi @softwaresean - there was a bug (#676) introduced in canary.13. It was fixed via #677 which was released with canary.15. If you update to canary.15 or higher (the latest is 17), does this fix your issue? |
I am facing the same issue. But I am not using gesture handler anywhere directly. I have installed it for drawer navigation. How to fix this? |
I have the same problem |
I updated all the packages related to navigation and it solved the issue. |
Any news? |
@thomazcapra Have you tried with the latest version? I just released the v4. https://www.npmjs.com/package/react-native-reanimated-carousel?activeTab=versions |
Describe the bug
Getting this error:
To Reproduce
Steps to reproduce the behavior:
"react-native-reanimated-carousel": "4.0.0-alpha.12"
in my project https://github.com/trevorpfiz/project-hyperI created a snack, but can't see the error there:
https://snack.expo.dev/@elektrikspark/joyous-violet-kiwi
Expected behavior
I would expect no issues with this library and
react-native-gesture-handler
Versions (please complete the following information):
Smartphone (please complete the following information):
Additional context
Let me know if more is needed, thanks!
The text was updated successfully, but these errors were encountered: