Chris Johnson
06/10/2024, 8:07 PMChris Johnson
06/10/2024, 8:07 PM@Composable
fun BadComposable() {
var count by remember { mutableStateOf(0) }
Button(onClick = { count++ }) {
Text("Recompose")
}
Text("$count")
count++
}
This is from the examples. I was going to test backwards writing but then realized this didn't make sense why it didn't just recompose immediately upon the count++
line since Text
is reading that value?Ben Trengrove [G]
06/11/2024, 12:10 AMChris Johnson
06/11/2024, 12:29 AM