grahammendick / navigation

Scene-Based Navigation for React and React Native
https://grahammendick.github.io/navigation/
Apache License 2.0
571 stars 40 forks source link

Supported Sheet Component #787

Closed grahammendick closed 2 months ago

grahammendick commented 2 months ago

The Sheet component replaces BottomSheet + React Native's Modal. For example,

<Sheet bottom={true} /> // gives a BottomSheet
<Sheet bottom={false} /> // gives a Full-Screen Sheet

The Sheet supports child NavigationStack components. Adding predictive gesture back support on Android was tricky because the gesture back goes to the ComponentDialog instead of the FragmentManager by default. The gesture back closed the dialog instead of going back through the stack. Had to build a custom FragmentHostCallback to hook up the FragmentManager's back stack to the ComponentDialog's OnBackPressedDispatcher.