Skip to content

Commit bd650c1

Browse files
committed
Remove code related to composeNavigator in NavHost since it seems also related to animations and transitions, and navigation is manually tested to work without it
1 parent 1114458 commit bd650c1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

navigation/src/jsMain/kotlin/com/huanshankeji/androidx/navigation/compose/NavHost.js.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,18 @@ actual fun NavHost(
6464
// Then set the graph
6565
navController.graph = graph
6666

67+
// This seems not needed here since it seems also related to animations and transitions. (comment added when adapting from Compose UI `NavHost)
68+
/*
6769
// Find the ComposeNavigator, returning early if it isn't found
6870
// (such as is the case when using TestNavHostController)
6971
val composeNavigator =
7072
navController.navigatorProvider.get<Navigator<out NavDestination>>(ComposeNavigator.NAME)
7173
as? ComposeNavigator ?: return
74+
*/
7275

7376
//val currentBackStack by composeNavigator.backStack.collectAsState()
7477

75-
// `progress`, `isPredictiveBack`, etc.
78+
// `progress`, `isPredictiveBack`, etc. (comment added when adapting from Compose UI `NavHost)
7679

7780
/*
7881
DisposableEffect(lifecycleOwner) {
@@ -98,12 +101,13 @@ actual fun NavHost(
98101
val backStackEntry: NavBackStackEntry? = visibleEntries.lastOrNull()
99102

100103
if (backStackEntry != null) {
101-
// TODO remove this if not needed
104+
/*
102105
DisposableEffect(true) {
103106
onDispose {
104107
visibleEntries.forEach { entry -> composeNavigator.onTransitionComplete(entry) }
105108
}
106109
}
110+
*/
107111

108112
// `fillMaxSize` is added here to make the Box align to the size of its parent
109113
// TODO consider adding a version of `NavHost` without `modifier` and `contentAlignment`
@@ -126,12 +130,13 @@ actual fun NavHost(
126130
}
127131
}
128132

129-
// TODO remove this if not needed
133+
/*
130134
DisposableEffect(true) {
131135
onDispose {
132136
visibleEntries.forEach { entry -> composeNavigator.onTransitionComplete(entry) }
133137
}
134138
}
139+
*/
135140
}
136141

137142
/*

0 commit comments

Comments
 (0)