State is the data that changes what your Compose UI looks like — a counter's value, whether a menu is open, the list of items fetched from a server. Getting…
collectAsStateWithLifecycle() is the recommended way to read a StateFlow (or any Flow) inside a composable. It replaced the older collectAsState() in most Android codebases for one specific reason: lifecycle awareness.…
Compose can skip recomposing a function entirely if it can prove none of its inputs actually changed. Whether it can prove that comes down to a concept called stability. Understanding…
Unnecessary recomposition — Compose re-running a function whose output hasn't actually changed — is the most common source of jank in a Compose app. Here's how to actually see it…
derivedStateOf exists to solve a specific, easy-to-miss performance problem: recomputing a value from other state on every recomposition, even when that computed value hasn't actually changed. The Problem It Solves…
mutableStateOf and MutableStateFlow both hold a value and notify observers when it changes, and both are common choices for state in a Compose app. They're not interchangeable, though — they…
A composable function is supposed to be free of side effects — it just describes UI based on its inputs, and Compose may call it more often than you'd expect,…
State hoisting is the pattern Compose uses instead of two-way data binding: rather than a component owning and mutating its own state, you move ("hoist") that state up to a…
Jetpack Compose gives you two closely related functions for holding UI state: remember and rememberSaveable. They look almost identical in code but behave very differently when your app is rotated,…
This is a curated index of Kotlin language fundamentals covered on this site — arrays, strings, and basic control flow. Each entry below links to a focused tutorial with working…