Skip to content

Conversation

@gorhom
Copy link
Owner

@gorhom gorhom commented Feb 1, 2021

close #251

Motivation

for some reason when when passing a parameter from an array, in android it will crash

// CRASH
requestAnimationFrame(() => runOnUI(animateToPoint)(snapPoints[currentIndexRef.current]));

// FIX
const newSnapPoint = snapPoints[currentIndexRef.current];
requestAnimationFrame(() => runOnUI(animateToPoint)(newSnapPoint));

Installation

yarn add ssh://[email protected]:gorhom/react-native-bottom-sheet#fix/prevent-crash-on-container-height-resizing

@gorhom gorhom added the v3 Written in Reanimated v2 label Feb 1, 2021
@gorhom
Copy link
Owner Author

gorhom commented Feb 1, 2021

hi @tankers746, could you please test this pr :)

@tankers746
Copy link
Contributor

Thanks thats fixed the issue
However the style change to BottomSheetContainer.tsx is now causing the sheet to be cut off. This is however only happening on my device with a notch.
Screenshot_20210202-142911_VROMO Driver

@gorhom
Copy link
Owner Author

gorhom commented Feb 2, 2021

the container will always align to the top, and that what will happened when you override its height

@tankers746
Copy link
Contributor

This is a problem with the automatic container height.

However I can see now this is just a case of RN not playing nice with my translucent status bar, for some reason the onLayout height in BottomSheetContainer is excluding the height of the status bar.

The change above does change the existing behaviour but I can work around it.

@gorhom
Copy link
Owner Author

gorhom commented Feb 2, 2021

if you provide a container height it will no longer do automatic layout measuring

@gorhom gorhom merged commit 759baa8 into v3 Feb 8, 2021
@gorhom gorhom deleted the fix/prevent-crash-on-container-height-resizing branch February 8, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 Written in Reanimated v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Animate on mount causing hard crash when container height changes on Android

3 participants