Skip to content

Commit

Permalink
Updated README to reflect latest API design for NavigationContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
chRyNaN committed Jul 12, 2023
1 parent f0b2976 commit c4af535
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Kotlin multi-platform application navigation library that supports Jetpack Compo
```kotlin
val navigator = rememberNavigator(initialDestination = "Greeting")

NavigationContainer(navigator) { destination ->
NavigationContainer(navigator) { (_, destination) ->
when (destination) {
"Greeting" -> Column {
Text("Hello")
Expand Down Expand Up @@ -117,7 +117,7 @@ recomposing its content accordingly. Just provide a `Navigator` instance and a c
fun App() {
val navigator = rememberNavigator(initialDestination = AppDestination.HOME)

NavigationContainer(navigator = navigator) { destination ->
NavigationContainer(navigator = navigator) { (context, destination) ->
when (destination) {
AppDestination.HOME -> HomeScreenComposable()
AppDestination.SEARCH -> SearchScreenComposable()
Expand Down Expand Up @@ -215,7 +215,7 @@ val navigator = Navigator(initialContext = MainContext.HOME)
navigation to non-composable UI components, such as starting new Activities or changing Fragments.

```kotlin
NavigationContainer(navigator) { destination ->
NavigationContainer(navigator) { (_, destination) ->
when (destination) {
is AppDestination.Details -> LaunchedEffect(destination) {
context.startActivity(DetailsActivity.newIntent(context, destinatin.id))
Expand Down

0 comments on commit c4af535

Please sign in to comment.