Reputation: 3356
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") }
}
}
Upvotes: 0
Views: 47