Closed Rc85 closed 9 months ago
These method must be flagged as worklet with the "worklet"
tag since they run on the UI thread by default, you can still use runOnJS
there if you need to run on the JS thread (eg. setState
, etc.).
const onDragEnd = (e) => {
"worklet";
console.log('drag', e);
}
return <DndProvider onDragEnd={onDragEnd}>
</DndProvider>
If I invoke the on methods, I get ReanimatedError: [Reanimated] Tried to synchronously call a non-worklet function on the UI thread.
If I don't invoke those method, no error.