android-maps-compose icon indicating copy to clipboard operation
android-maps-compose copied to clipboard

View isn't updated after recomposition

Open Jasperav opened this issue 1 year ago • 16 comments

I have seen it in more complex applications, but this is the easiest reproduction view:

@Composable
fun ClusterItemConversation() {
    val x = remember { mutableIntStateOf(0) }

    LaunchedEffect(key1 = Unit) {
        // This just delays the execution
        dispatchToMainThread(2000) {
            x.value += 1

            log { "Updated" }
        }
    }

    Column(verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally) {
        Text(text = x.value.toString())
    }
}

// Some map code...
Clustering(items = clusterItems, clusterItemContent = { ci ->
    ClusterItemConversation()
})

In the logging I can observe that Updated is there, but the view isn't updated at all, the text remains 0. The view is out of sync.

Jasperav avatar Dec 30 '23 14:12 Jasperav