File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
challenges/react-navigation Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
- Add an auth flow
6
6
7
- ## 👨🚀 Exercise 4 Authentication
7
+ ## 👨🚀 Exercise 4
8
8
9
9
- [ ] Add an Authentication flow to your application
10
10
11
+ Example:
12
+
13
+ ``` javascript
14
+ function App () {
15
+ const [isSignedIn , setIsSignedIn ] = useState (false );
16
+
17
+ return (
18
+ < NavigationContainer>
19
+ {isSignedIn ? < RootNavigator / > : < AuthNavigator / > }
20
+ < / NavigationContainer>
21
+ );
22
+ }
23
+ ```
24
+
11
25
You can read the documentation [ https://reactnavigation.org/docs/auth-flow ] ( https://reactnavigation.org/docs/auth-flow )
12
- _ Hint:_ For now you can emulate the token with a simple ` useState ` . Later we will see how to use ` AsyncStorage ` to keep the token on the phone.
26
+ _ Hint:_ For now you can emulate the token with a simple ` useState ` .
13
27
14
28
### 👽 Bonus
15
29
You can’t perform that action at this time.
0 commit comments