tezvyn:

Diagnose Compose recomposition issues and explain lambda stability

Source: developer.android.comadvanced

Tests Compose skipping and stability. Strong answers name recomposition counts, compiler metrics, and immutable state, then explain unremembered lambdas create new instances and prevent skipping.

Tests deep understanding of Compose recomposition skipping and runtime stability. A strong answer names Layout Inspector recomposition counts, Compose Compiler metrics, and SideEffect logging. It explains that Compose skips children only when inputs are stable and unchanged, so unstable data classes or var properties force subtree recompositions. It also covers lambda stability: capturing lambdas create new instances each call unless remembered or converted to method references, causing Compose to see changed inputs.

Read the original → developer.android.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Diagnose Compose recomposition issues and explain lambda stability · Tezvyn