Skip to content

Commit 099f98a

Browse files
committed
Update navigation
1 parent 59d095e commit 099f98a

File tree

1 file changed

+16
-2
lines changed
  • challenges/react-navigation

1 file changed

+16
-2
lines changed

challenges/react-navigation/04.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@
44

55
- Add an auth flow
66

7-
## 👨‍🚀 Exercise 4 Authentication
7+
## 👨‍🚀 Exercise 4
88

99
- [ ] Add an Authentication flow to your application
1010

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+
1125
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`.
1327

1428
### 👽 Bonus
1529

0 commit comments

Comments
 (0)