https://kotlinlang.org logo
#compose
Title
# compose
g

gpaligot

11/05/2020, 8:16 PM
Hi all, I’m trying to use compose navigation but when I want to use
navController.navigate("my_route")
, I got an error because it doesn’t find any signature with just a string as first parameter. Someone have any idea why? My full source code:
Copy code
@Composable
fun Screen() {
  val navController = rememberNavController()
  NavHost(navController, startDestination = "movies") {
    composable("movies") {
      MovieHome(navController = navController, movies = movies) {
        navController.navigate("movies_detail")
      }
    }
    composable("movies_detail") {
      MovieDetails(movie = joker)
    }
  }
}
s

subashz

11/05/2020, 8:19 PM
g

gpaligot

11/05/2020, 8:21 PM
Oh... this should be in the documentation or the function should be renamed. Thanks @subashz
s

subashz

11/05/2020, 8:23 PM
Yep,
i

Ian Lake

11/05/2020, 8:29 PM
You should file a bug against Studio if it isn't being suggested as a quick fix: https://issuetracker.google.com/issues/new?component=192708
3 Views