Your Code is Eating Recompositions - Optimize it with THIS Trick
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
Using a regular Kotlin List as a Jetpack Compose composable parameter causes unnecessary recompositions because List is an interface and considered unstable by the Compose compiler. Switching to ImmutableList (via persistentListOf) guarantees immutability, allowing the compiler to skip recompositions when parameters haven't changed. The post also covers the Compose Stability Analyzer plugin for tracking recomposition counts and gutter icons, and warns that even with ImmutableList, any mutable field (var) in the data class will make the type unstable and trigger recompositions.
•8m watch time
209 Impressions