react-native-bottom-sheet: runOnJS Errors in Reanimated 2.0.0-alpha.8

Bug

Reanimated V2 just released 2.0.0-alpha.8. It offers lots of fixes over 2.0.0-alpha.7 and no longer requires turbo modules to be globally enables (no more AppDelegate setup). There is a breaking change in that you now must explicitly specify which thread you’re running a function, either runOnJS or runOnUI. Functions must either runOnUI if they are to be sync or runOnJS if they are to be async. See here.

In iOS using the bottom sheet results in this error:

Simulator Screen Shot - iPhone 11 - 2020-11-01 at 23 09 38

Environment info

Library Version
@gorhom/bottom-sheet 2.0.0-alpha.0
react-native 0.63.2
react-native-reanimated 2.0.0-alpha.8
react-native-gesture-handler 1.7.0

Steps To Reproduce

Use bottom-sheet with Reanimated V2 2.0.0-alpha.8

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 24 (6 by maintainers)

Most upvoted comments

Does anyone have a fix for this? Still occurs in Expo 42 and “@gorhom/bottom-sheet”: “^4.0.2”,

hi @Johan-dutoit, thanks for testing it on both platforms.

I will prepare the release later today 👏

@gorhom heads up, alpha.9 was released a few hours ago

@gorhom I can see this error in version 4.2.1 with "react-native-reanimated": "^2.8.0", Simulator Screen Shot - iPhone 13 - 2022-04-30 at 00 10 05

still seeing this issue on latest version of reanimated + gorhom/bottom-sheet

this should be fix with the latest release v2.0.0-alpha.1 👏

i’ll keep an eye on the issue 👍

@gorhom These issues have resurfaced on all version 3 of bottom-sheet. I have now reverted to the latest version 2 where it works well.

I’ve upgraded to 9.1, just to test this and not getting any error on iOS (using the PR code)

@darrylyoung I hear you. I’ve personally decided to stop initialising a new project with expo, it has a lot of drawbacks from my little experience with it. If you can, replace your icons with their svg versions. It might be a bit of work if you have so many icons, but it’s worth the peace of mind. Plus SVGs are better icons to font-icons (but that’s a different conversation 🤓)…

I just tried this for the first time – using version 3 – and get the same issue mentioned above. For context, I’m testing in the iOS Simulator and I’m running an ejected (bare) Expo project. Related packages installed are:

{
  "@gorhom/bottom-sheet": "^3",
  "react-native-reanimated": "^2.1.0",
}

I’m just trying the example as shown in the documentation. Let me know if there’s anything else you’d like me to check.

I must have messed up pulling the PR code, I tried it again and the error is gone. Thank you so much @gorhom for the great work!

Hi @gorhom, I can confirm it fixes the errors/warnings for me, running on v2 alpha9. This is for both Android & iOS, latest RN.

P.s. thanks for the speedy fix 😄

Hey @gorhom just wanted to give you a heads up that alpha.9 should be coming real soon and along with it the scrollTo fix.

Understandable, thanks for the update @gorhom!

@ksitko thanks for submitting this issue, i am already working on a new alpha release 👍