diff --git a/src/BottomSheetView.tsx b/src/BottomSheetView.tsx index cc6f6c9..c2ee70e 100644 --- a/src/BottomSheetView.tsx +++ b/src/BottomSheetView.tsx @@ -21,7 +21,7 @@ type BottomSheetModalScreenProps = BottomSheetModalProps & { navigation: BottomSheetNavigationProp; }; -function Overlay({ children }: { children: React.ReactNode }) { +function Overlay({ children }: { children?: React.ReactNode }) { if (Platform.OS === 'ios') { return ( @@ -132,51 +132,50 @@ export function BottomSheetView({ state, descriptors }: Props) { return ( <> {firstScreen.render()} - - {shouldRenderProvider.current && ( - - {state.routes.slice(1).map((route) => { - const { options, navigation, render } = descriptors[route.key]; - - const { - index, - backgroundStyle, - handleIndicatorStyle, - snapPoints, - enableDynamicSizing, - ...sheetProps - } = options; - - return ( - - {render()} - - ); - })} - - )} - + {shouldRenderProvider.current && ( + + {state.routes.slice(1).map((route) => { + const { options, navigation, render } = descriptors[route.key]; + + const { + index, + backgroundStyle, + handleIndicatorStyle, + snapPoints, + enableDynamicSizing, + ...sheetProps + } = options; + + return ( + + {render()} + + ); + })} + + )} ); }