From 8f0efc8db534297a95ea8a2bcb6d2e387c1fea53 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Sat, 7 Nov 2020 14:39:23 +0100 Subject: [PATCH] fix: don't hide child header automatically in stack --- example/src/Screens/BottomTabs.tsx | 10 ++++++++-- example/src/Screens/MaterialBottomTabs.tsx | 10 ++++++++-- example/src/Screens/SimpleStack.tsx | 8 ++++++-- .../stack/src/views/Header/HeaderContainer.tsx | 16 +++++----------- packages/stack/src/views/Stack/CardStack.tsx | 7 ++----- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/example/src/Screens/BottomTabs.tsx b/example/src/Screens/BottomTabs.tsx index 5ae63d51..458c7d36 100644 --- a/example/src/Screens/BottomTabs.tsx +++ b/example/src/Screens/BottomTabs.tsx @@ -86,12 +86,18 @@ export default function BottomTabsScreen({ > + > + {(props) => ( + + )} + + > + {(props) => ( + + )} + (); export default function SimpleStackScreen({ navigation, -}: StackScreenProps) { + screenOptions, +}: StackScreenProps & { + screenOptions?: StackNavigationOptions; +}) { React.useLayoutEffect(() => { navigation.setOptions({ headerShown: false, @@ -113,7 +117,7 @@ export default function SimpleStackScreen({ }, [navigation]); return ( - + { ? this.state.scenes.slice(-2).some((scene) => { const { descriptor } = scene; const options = descriptor ? descriptor.options : {}; - const { - headerTransparent, - headerShown = isParentHeaderShown === false, - } = options; + const { headerTransparent, headerShown = true } = options; if (headerTransparent || headerShown === false) { return true; @@ -542,7 +539,7 @@ export default class CardStack extends React.Component { const { safeAreaInsets, - headerShown = isParentHeaderShown === false, + headerShown = true, headerTransparent, cardShadowEnabled, cardOverlayEnabled,