Skip to content

Commit

Permalink
Updated README file with nested navigation information
Browse files Browse the repository at this point in the history
  • Loading branch information
chRyNaN committed Dec 19, 2021
1 parent 18b2d8f commit 90bb66f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ navigator.goTo(HomeNavigationIntent.Farewell)
navigator.goBack()
```

##### Nested navigation

Within the scope of the content blocks, you can access the `navigator` property which can be used for nested navigation:

```kotlin
val navigator = rememberNavigatorByKey("Hello") { key ->
when (key) {
"Greeting" -> Button("Hello") {
navigator.goBack() // Safe access to the navigator property within this scope.
}
"Farewell" -> Text("Good-bye")
else -> Text("Unexpected Key: $key")
}
}
```

#### Android

To create a `Navigator` use one the provided `navigator()` functions. For instance:
Expand Down

0 comments on commit 90bb66f

Please sign in to comment.