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

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

There is a newer version: 3.0.13
Show 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