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

Jason Ankers

02/22/2021, 4:28 AM
Referencing my navController inside a
LazyColumn
seems to cause an infinite recompose loop. Anyone know why this might be happening?
i

Ian Lake

02/22/2021, 5:42 AM
"referencing" or actually doing something with it?
j

Jason Ankers

02/22/2021, 5:45 AM
In my case it’s just being passed down to another composable:
Copy code
item {
    MyComposable(navController = navController)
}
i

Ian Lake

02/22/2021, 6:04 AM
So what is that doing with the NavController?
j

Jason Ankers

02/22/2021, 6:49 AM
It’s passed down until eventually I use it to navigate as part of an
onClick
. The lower down intermediate composables aren’t recomposing though - just the one which renders
LazyColumn
. I could even just call toString and it will happen:
item { Text(navController.toString()) }
(this will cause it to infinitely recompose)
a

Andrey Kulikov

02/22/2021, 12:20 PM
please file a bug with the full code, so we can investigate
j

Jason Ankers

02/23/2021, 9:09 AM