useFrameCallback had a bit faulty cleanup: it used ref.current during useEffect cleanup, when the ref value could as well be unreachable (already deallocated). I added the callbackId memoization + removed unnecessary setting it to -1.
Test plan
useFrameCallback example from Example App, as well as this code:
Summary
useFrameCallback
had a bit faulty cleanup: it used ref.current during useEffect cleanup, when the ref value could as well be unreachable (already deallocated). I added thecallbackId
memoization + removed unnecessary setting it to -1.Test plan
useFrameCallback example
from Example App, as well as this code:Code
``` TYPESCRIPT import React from 'react'; import { StyleSheet, View } from 'react-native'; import Animated, { useFrameCallback, useSharedValue, useAnimatedStyle, } from 'react-native-reanimated'; export default function App() { const t = useSharedValue