All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.captain.Router.kt Maven / Gradle / Ivy

The newest version!
package captain

import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider

@Composable
fun Router(
    start: String = "/",
    navigator: Navigator = BasicNavigator(start),
    content: @Composable () -> Unit
) {
    if (start != navigator.current().path) navigator.navigate(start)
    CompositionLocalProvider(LocalNavigator provides navigator) {
        content()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy