Skip to content

Commit e97ae0c

Browse files
committed
Tweak auth flow docs
1 parent 7de2198 commit e97ae0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

versioned_docs/version-5.x/auth-flow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ This pattern has been in use by other routing libraries such as React Router for
4444

4545
The magic happens when the value of the `isSignedIn` variable changes. Let's say, initially `isSignedIn` is `false`. This means, either `SignIn` or `SignUp` screens are shown. After the user signs in, the value of `isSignedIn` will change to `true`. React Navigation will see that the `SignIn` and `SignUp` screens are no longer defined and so it will remove them. Then it'll show the `Home` screen automatically because that's the first screen defined when `isSignedIn` is `true`.
4646

47-
It's important to note that when using such a setup, you **don't need to navigate** to the `Home` screen manually by calling `navigation.navigate('Home')`. React Navigation will automatically navigate to the `Home` screen when `isSignedIn` becomes `true`.
47+
It's important to note that when using such a setup, you **don't need to manually navigate** to the `Home` screen by calling `navigation.navigate('Home')` or any other method. **React Navigation will automatically navigate to the correct screen** when `isSigned` in changes - `Home` screen when `isSignedIn` becomes `true`, and to `SignIn` screen when `isSignedIn` becomes `false`. You'll get an error if you attempt to navigate manually.
4848

49-
This takes advantage of a new feature in React Navigation: being able to dynamically define and alter the screen definitions of a navigator based on props or state. The example shows stack navigator, but you can use the same approach with any navigator.
49+
The example shows stack navigator, but you can use the same approach with any navigator.
5050

5151
By conditionally defining different screens based on a variable, we can implement auth flow in a simple way that doesn't require additional logic to make sure that the correct screen is shown.
5252

0 commit comments

Comments
 (0)