Hi all :android-wave:, Is there any difference bet...
# compose-android
a
Hi all 👋, Is there any difference between using
map
or
forEach
in a
Composable
? E.g
Copy code
@Composable
fun TextList(strings: List<String>) {
  strings.map {
    Text(it)
  }
}
vs
Copy code
@Composable
fun TextList(strings: List<String>) {
  strings.forEach {
    Text(it)
  }
}
j
Map is strictly worse
👌 6
It conveys the wrong intent, but also allocates a new list every time it's invoked
👆 5
👆🏾 2
a
thank you color
a
Use
fastForEach
if public in compose lib