BenJeau / react-native-draw

SVG based data-driven React Native drawing component 🎨
https://www.npmjs.com/package/@benjeau/react-native-draw
MIT License
131 stars 41 forks source link

Support reanimated #59

Open tiamed opened 2 years ago

tiamed commented 2 years ago

Is your feature request related to a problem?

This library currently conflicts with react-native-reanimated@2 or react-native-gesture-handler@2.1.3 showing the error tried to synchronously call function from a different thread

Desired solution (feature)

Mark functions like addPointToPath as a worklet or wrap it using runOnJS

Alternatives considered

No response

Anything else?

https://docs.swmansion.com/react-native-gesture-handler/docs/2.3.0/api/gestures/base-gesture-config/#runonjsvalue-boolean

simonapostolovski commented 2 years ago

I had the same issue, check here https://stackoverflow.com/a/71691422/13667202

Same has been reported here https://github.com/software-mansion/react-native-reanimated/issues/2710

I added the runOnJS(true) to the Gesture and its not crashing any more. image