Open starheH opened 2 months ago
I face this too, here is my code:
const onTranslationYChange = useCallback((translationY, shouldClose) => {
console.log('🚀 ~ translationY:', translationY);
}, []);
So I fixed it by adding the worklet
before the console.log
and it works.
const onTranslationYChange = useCallback((translationY, shouldClose) => {
'worklet';
console.log('🚀 ~ translationY:', translationY);
}, []);
When I set the onTranslationYChange event and drag the image up and down, the following exception occurs:
ReanimatedError: [Reanimated] Tried to synchronously call a non-worklet function on the UI thread.
It seems that onTranslationYChange is not called through runOnJS.
RN: 0.75 react-native-awesome-gallery: 0.4.2