diff --git a/compose/src/main/kotlin/app/meetacy/di/android/compose/navigation/NavController.kt b/compose/src/main/kotlin/app/meetacy/di/android/compose/navigation/NavController.kt index 528fd2e..fad21b7 100644 --- a/compose/src/main/kotlin/app/meetacy/di/android/compose/navigation/NavController.kt +++ b/compose/src/main/kotlin/app/meetacy/di/android/compose/navigation/NavController.kt @@ -1,3 +1,5 @@ +@file:Suppress("NAME_SHADOWING") + package app.meetacy.di.android.compose.navigation import androidx.compose.runtime.* @@ -26,6 +28,10 @@ public fun NavigationScreen( } @Composable -public fun buildNavigationDI(di: DI): DI = di + di { - val navController by provider { LocalNavController.current } +public fun buildNavigationDI(di: DI): DI { + val navController = LocalNavController.current + + return di + di { + val navController by constant(navController) + } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6632aa0..7f3ba9e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ composeCompiler = "1.5.6" androidxNavigation = "2.7.7" lifecycle = "2.6.1" -mdi = "0.0.33" +mdi = "0.0.34" [libraries]