File tree 1 file changed +13
-10
lines changed
versioned_docs/version-7.x
1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -83,13 +83,13 @@ const RootStack = createNativeStackNavigator({
83
83
},
84
84
},
85
85
});
86
- // codeblock-focus-end
87
86
88
87
const Navigation = createStaticNavigation (RootStack);
89
88
90
89
export default function App () {
91
90
return < Navigation / > ;
92
91
}
92
+ // codeblock-focus-end
93
93
94
94
function HomeScreen () {
95
95
return < View / > ;
@@ -124,35 +124,38 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack';
124
124
125
125
const Stack = createNativeStackNavigator ();
126
126
127
- const getIsSignedIn = () => {
128
- // custom logic
127
+ const useIsSignedIn = () => {
129
128
return true ;
130
129
};
131
130
131
+ const useIsSignedOut = () => {
132
+ return false ;
133
+ };
134
+
135
+ // codeblock-focus-start
132
136
export default function App () {
133
- const isSignedIn = getIsSignedIn ();
137
+ const isSignedIn = useIsSignedIn ();
134
138
135
139
return (
136
140
< NavigationContainer>
137
141
< Stack .Navigator >
138
- // codeblock-focus-start
139
142
{isSignedIn ? (
140
- <>
143
+ < Stack . Group >
141
144
< Stack .Screen name= " Home" component= {HomeScreen} / >
142
145
< Stack .Screen name= " Profile" component= {ProfileScreen} / >
143
146
< Stack .Screen name= " Settings" component= {SettingsScreen} / >
144
- < / >
147
+ < / Stack . Group >
145
148
) : (
146
- <>
149
+ < Stack . Group >
147
150
< Stack .Screen name= " SignIn" component= {SignInScreen} / >
148
151
< Stack .Screen name= " SignUp" component= {SignUpScreen} / >
149
- < / >
152
+ < / Stack . Group >
150
153
)}
151
- // codeblock-focus-end
152
154
< / Stack .Navigator >
153
155
< / NavigationContainer>
154
156
);
155
157
}
158
+ // codeblock-focus-end
156
159
157
160
function HomeScreen () {
158
161
return < View / > ;
You can’t perform that action at this time.
0 commit comments