HomePhabricator
Diffusion Comm 647baa08494b

[native] improve BottomSheet component close function

Description

[native] improve BottomSheet component close function

Summary:
As I was working with/testing out the bottom sheet component, I was running into a bug where if I quickly pressed the bottom sheet backdrop again before the bottom sheet was fully open the onChange callback would not get called. This meant that I was unable to navigate back away from the user profile bottom sheet screen and I would be stuck.

I read through the docs again and I actually found a better prop called onDismiss that just always get called whenever the bottom sheet gets dismissed regardless if the bottom sheet was fully opened or not.

https://gorhom.github.io/react-native-bottom-sheet/modal/props#ondismiss

With onDismiss we can just pass in the onClosed callback prop making the implementation a lot more simple!

Depends on D9258

Test Plan:
Confirmed that when I press the bottomsheet backdrop before the bottomsheet fully opens, I can successfully navigate back when the bottom sheet dismisses

Reviewers: atul, inka

Reviewed By: atul

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D9260

Details

Provenance
ginsuAuthored on Sep 16 2023, 8:34 PM
Reviewer
atul
Differential Revision
D9260: [native] improve BottomSheet component close function
Parents
rCOMMc4c8db828ad9: [native] introduce UserProfileRelationshipButton
Branches
Unknown
Tags
Unknown