In this article
What’s changed
- Renamed
nativeOverlaytowindowOverlayonModalBottomSheet. The overlay behaves as before. - Changed
settleDurationto milliseconds. The default is450. Values below10trigger a development warning to help catch values still expressed in seconds. - Unified close requests on
ModalBottomSheet. Scrim taps, screen reader dismiss actions, Android system back, and Escape on Android and the web all callonCloseRequestwhen supplied. The sheet stays in place until the handler changes its index. Dragging closed still reports throughonIndexChange. - Added
onCloseRequestsupport on iOS for scrim taps, the scrim’s Dismiss button, and the VoiceOver escape gesture. - Changed the default dismissal behavior. Without a handler, these requests snap the sheet to its closed detent and report through
onIndexChangewhen the scrim is visible and the closed detent allows user interaction. Android back and Escape stay consumed through the closing animation. On the web, only the top modal receives Escape, even when it takes no action. - Added
startandendto detentinsets. They follow the layout direction and override the correspondingleftorrightinset. On the web, they use the document direction. Also fixedsurfaceStylestart and end corner radii in right-to-left web documents. - Expanded
scrimColorto accept anyColorValue, includingPlatformColorandDynamicColorIOS. - Updated the
wrapNativeViewtype to hide internal native props.Animated.createAnimatedComponentstill works. Added theBottomSheetProviderPropstype export. - Declared
react-domandreact-native-webas optional peer dependencies.
Migrating from 0.18.1
- Rename
nativeOverlaytowindowOverlayand keep its value. - Multiply explicit
settleDurationvalues by 1,000. For example, changesettleDuration={0.55}tosettleDuration={550}. - Review
onCloseRequesthandlers. To dismiss, setindexto the closed detent in the handler. For example, if the closed detent is first, useonCloseRequest={() => setIndex(0)}. - Review sheets without a handler. To keep one open on Android back or Escape, add a no-op
onCloseRequesthandler or mark the closed detentprogrammatic. - If a
wrapNativeViewwrapper explicitly types its parameter with native props, useComponentType<any>for that parameter.
Release card