Using setState inside onActive of gestureEvent crashes the whole app #2061
Unanswered
luciomoriconi
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I think It's crashing because you're trying to access a JS Function from the native thread.
And change your call like this: onActive: e => {
if (e.translationX) {
runOnJS(moveDot)(0, 0.001);
}
}, I think it should work |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following setup inside a component (using Android in AndroidStudio)
Where
moveDot
is a handler for asetState
that changes thestart
value usedstartStyle
. I need to handle the state out of this component because it's part of the overall value of a form.Whenever I use
moveDot
inside of the gesture handler (which only happens when I drag out of my Animated.View), the app just crashes with no error message. Any idea why this happens?Thanks in advance for any help
Beta Was this translation helpful? Give feedback.
All reactions