Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] null is not an object (evaluating 'sheetsQueueRef.current[sheetsQueueRef.current.length - 1].ref.current.minimize') #323

Closed
Yonom opened this issue Mar 4, 2021 · 7 comments · Fixed by #327
Assignees
Labels
bug Something isn't working v2 Written in Reanimated v1

Comments

@Yonom
Copy link

Yonom commented Mar 4, 2021

Bug

Environment info

Library Version
@gorhom/bottom-sheet 2.2.2
react-native 0.63.4
react-native-reanimated 1.13.2
react-native-gesture-handler 1.10.3

Steps To Reproduce

  1. Add BottomSheetModalProvider to the root App component.
  2. Use BottomSheetModal on some screen in the app.
  3. Go to that screen and present/dismiss BottomSheetModal a couple of times, then go back to previous screen and return back to screen with BottomSheetModal and it crashes.

Same as #292

Describe what you expected to happen:

  1. No crash

Reproducible sample code

<BottomSheetModal
  ref={ref}
  snapPoints={[500]}
  backgroundComponent={() => <View />}
  backdropComponent={BottomSheetBackdrop}
  handleComponent={() => <View />}
  index={0}
  onChange={() => {}}
  onDismiss={() => {}}
>
  // ...
</BottomSheetModal>
@Yonom Yonom added the bug Something isn't working label Mar 4, 2021
@braincore
Copy link

Just tried this library today and immediately ran into this issue as well. My setup is almost identical to yours. A simple reproduction is to simply have two modals mounted at the same time.

I'm guessing that there's an issue with the StackBehavior logic which the docs say isn't implemented for v2 (though what the v2 behavior should be is unclear).

@gorhom gorhom self-assigned this Mar 4, 2021
@gorhom gorhom added the v2 Written in Reanimated v1 label Mar 4, 2021
@braincore
Copy link

While I haven't thoroughly tested, just wanted to verify that moving to v3.3.3 appears to solve the immediate problem.

@Yonom
Copy link
Author

Yonom commented Mar 5, 2021

I am not able to upgrade to v3 yet, since it requires a prerelease library (reanimated 2)

@gorhom
Copy link
Owner

gorhom commented Mar 13, 2021

this should be fixed with v2.2.4

@Yonom
Copy link
Author

Yonom commented Mar 20, 2021

@gorhom Originally, this issue appeared only on Android and since the fix on v2.2.4, we have stopped seeing this issue among our Android userbase

Unfortunately, the same issue has popped up on iOS now:

null is not an object (evaluating 'currentMountedSheet.ref.current.minimize')

It seems like a weird race condition of some sort...

Reproduction steps

on iOS navigate to a screen with bottom sheet, open it, close it, go back and repeat several times

Environment info

Library Version
@gorhom/bottom-sheet 2.2.4
react-native 0.63.4
react-native-reanimated 1.13.2
react-native-gesture-handler 1.10.3

@anthowm
Copy link

anthowm commented May 10, 2021

I get this error in android by the moment

Library Version
@gorhom/bottom-sheet 2.3.0
react-native 0.64.0
react-native-reanimated 1.13.3
react-native-gesture-handler 1.10.3

@chintanbawa
Copy link

Hi @Yonom, Did you fix this issue for iOS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2 Written in Reanimated v1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants