I know I'm probably jumping the gun a bit with the...
# compose
j
I know I'm probably jumping the gun a bit with the navigation updates n 1.6.10-beta01 (and realise it's experimental ) but should argument passing work right now?
s
I can’t find it right now but I’ve seen somewhere someone mentioning that for iOS there was something wrong with some types of argument passing. I am trying to find more about it now. FWIW this sample https://github.com/MatkovIvan/nav_cupcake is something that does work so you can give a look there to see if you are doing something differently perhaps?
j
yeah, have been comparing to that but it doesn't actually pass any arguments
maybe doing something basic wrong here....hacking together something and have for example
Copy code
composable(route = "details/{countryName}") { backStackEntry ->
}
and then
Copy code
navController.navigate("details/${country.name}")
and get this error then (in Compose for Desktop app in this case)
s
Does it help in any way if over at
composable(route = “details/{countryName}“)
you also pass in there the navType explicitly? Not sure if the API for the KMP version is the same but if it is, something like this
Copy code
composable(
        "details/{countryName}",
        arguments = listOf(navArgument("countryName") { type = NavType.StringType })
    )
j
yeah, I tried that as well
s
And if this also does not work, how about trying to use it as an optional parameter? Just for the sake of trying
Copy code
composable(
        "details?countryName={countryName}",
        arguments = listOf(navArgument("countryName") { type = NavType.StringType })
    )
and maybe there was some API to say that it’s nullable? I can’t find smth right now
Oh also, what if you add a defaultValue like
Copy code
navArgument("...") { defaultValue = "somethingHere" }
does that change anything?
j
tried those but same result
kodee sad 1
i
j
ah, cool, thanks
I'm probably missing something basic but trying latest dev versions (which I thought would include above commit) but that's still not working. Using
2.8.0-dev1593
maybe some additional changes were needed on top of that
i
There definitely were a few more fixes done after that one, namely https://github.com/JetBrains/compose-multiplatform-core/pull/1289
👍 1
j
ah, perhaps that might be included in next dev build
Copy code
Navigation
Support parsing navigation arguments (#1277, #1289)