File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
examples/NavigationPlayground/js Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ const MyNavScreen = ({ navigation, banner }) => (
26
26
/>
27
27
{ navigation . state . routeName === 'HeaderTest' && < Button
28
28
title = "Toggle Header"
29
- onPress = { ( ) => navigation . setParams ( { header : ( ! navigation . state . params || navigation . state . params . header === 'visible' ) ? 'none' : 'visible' } ) }
29
+ onPress = { ( ) => navigation . setParams ( {
30
+ headerVisible : ( ! navigation . state . params || ! navigation . state . params . headerVisible ) ,
31
+ } ) }
30
32
/> }
31
33
< Button
32
34
onPress = { ( ) => navigation . goBack ( null ) }
@@ -64,7 +66,9 @@ const ProfileNavigator = StackNavigator({
64
66
screen : MyProfileScreen ,
65
67
} ,
66
68
} , {
67
- navigationOptions : { headerVisible : false } ,
69
+ navigationOptions : {
70
+ header : null ,
71
+ } ,
68
72
} ) ;
69
73
70
74
const MyHeaderTestScreen = ( { navigation } ) => (
@@ -73,11 +77,10 @@ const MyHeaderTestScreen = ({ navigation }) => (
73
77
navigation = { navigation }
74
78
/>
75
79
) ;
76
- MyHeaderTestScreen . navigationOptions = ( { navigation} ) => {
77
- const header = navigation . state . params && navigation . state . params . header ;
78
- const headerVisible = ! header || header === 'visible' ;
80
+ MyHeaderTestScreen . navigationOptions = ( { navigation } ) => {
81
+ const headerVisible = navigation . state . params && navigation . state . params . headerVisible ;
79
82
return {
80
- headerVisible,
83
+ header : headerVisible ? undefined : null ,
81
84
title : 'Now you see me' ,
82
85
} ;
83
86
} ;
You can’t perform that action at this time.
0 commit comments