0

Clicking the foo button the second and subsequent times causes the code for the bar button to be executed. It seems related to the collection that I map to P elements.

fun main() {
    renderComposableInBody {
        val words = remember { mutableStateListOf<String>() }
        words.map { P { Text(it) }}
        Button(attrs = { onClick { words.add("foo") } }) { Text("foo") }
        Button(attrs = { onClick { words.add("bar") } }) { Text("bar") }
    }
}
user2297550
  • 3,142
  • 3
  • 28
  • 39
  • 1
    I can't replicate this issue. Perhaps it has been fixed in the recent versions of Compose. – Serge Mar 14 '23 at 02:44
  • @Serge thank you for trying to replicate and thereby verifying that it's been fixed. Good to know as it motivates me to resume elegant coding! – user2297550 Mar 15 '23 at 13:22

0 Answers0