Closed jameheller98 closed 6 days ago
Hey @jameheller98 I have so many questions. Could you tell us what exactly is the problem? When i tried using your code that you provided, all of our examples using useFrameCallback
stopped working as intended because of your callbackId logic. What exactly do you want us to do?
Funfact: if you change autostart
argument in the snack to true (or just remove it), it will work fine
This here video example about error:
Uploading screen-20240624-204905~2.mp4…
I have found error when ref.current.callbackId not update in useEffect hook you can check.
@jameheller98 there is no video 😄
@szydlovsky
You can check again.
And file fix you can check
@jameheller98 alright, I can see there is some kind of error but I can't really go into detail and investigate without any reproduction. Please refer to how to make a minimal repro.
Your file fix unfortunately doesn't do the job - it breaks the logic of callbackId (stopping and activating callbacks doesn't work anymore because of wrong callbackId).
Other than that, I am also a bit puzzled that your fix contains changes to the code that weren't there yet as of 3.12 (they are present only on main branch and a few recent nightly builds).
Okay I have found problem, its terrible with my code and thank to issue https://github.com/software-mansion/react-native-reanimated/issues/5525, I fix my code I had use
runOnJS(frameCb.setActive)(true)
in a worklet and that terrible, thank support to me @szydlovsky
Description
I test useFrameCallback and its not work, after I check hook useFrameCallback in library, and I fix code and its work, i dont know how to useRef work to object and you can check code me about problem.
Steps to reproduce
useFrameCallback in project
Snack or a link to a repository
https://snack.expo.dev/@jameheller98/useframecallback
Reanimated version
^3.12.0
React Native version
0.71.7
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
Android emulator
Device model
Google pixel 6
Acknowledgements
Yes