0Pricing
Jetpack Compose Academy · Lesson

Stable vs Unstable Parameters

Understand what keeps Composables skippable.

Stable vs Unstable Parameters is a free Jetpack Compose Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Jetpack Compose Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Skipping Means

When a Composable re-runs but its inputs have not changed, Compose can skip it entirely. Skipping is how fast Compose apps stay fast. 🚀

Stability Decides Skipping

Compose only skips a Composable when every parameter is stable. One unstable input and the whole function re-executes on each recomposition.

What "Stable" Promises

A type is stable when Compose trusts that equals() is reliable and that public properties will not change without telling Compose.

Naturally Stable Types

Primitives, String, and function types are stable out of the box, so passing an Int or a lambda never blocks skipping.

fun Greeting(name: String, count: Int) {
  Text("Hello $name x$count")
}

val Properties Are Stable

A class with only val properties of stable types is itself stable. Immutable data is the friendliest input you can give Compose.

data class User(val id: Int, val name: String)

var Makes a Type Unstable

A mutable var property can change behind Compose's back, so the class becomes unstable and its Composable can no longer skip.

data class Counter(var value: Int)

Collections Look Unstable

Plain List, Map, and Set are treated as unstable, because the interface could hide a mutable ArrayList underneath.

fun ItemRow(items: List<String>) { }

Why Interfaces Worry Compose

An interface parameter is unstable: the concrete implementation is unknown at compile time, so Compose cannot guarantee its equals() behaves.

Strong Skipping Mode

Newer Compose ships strong skipping, which lets unstable parameters compare by reference, so many cases skip without extra annotations.

Spotting Unstable Inputs

If a Composable redraws every frame for no visible reason, suspect an unstable parameter forcing a full re-run each time.

Stability Is About Trust

Stability is a promise to Compose, not magic. The more immutable your inputs are, the more work Compose is free to skip.

Quick Check

Test your grasp of stability.

Recap: Stable Wins

Compose skips a Composable only when every input is stable. Favor primitives, Strings, and val-only classes to keep redraws cheap. ✅

Frequently asked questions

Is the “Stable vs Unstable Parameters” lesson free?

Yes — the full text of “Stable vs Unstable Parameters” is free to read here on the web, and the Jetpack Compose Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Jetpack Compose Academy course, upgrade to CoddyKit PRO.

What will I learn in “Stable vs Unstable Parameters”?

Understand what keeps Composables skippable. You practise Jetpack Compose Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Jetpack Compose Academy?

No prior experience is required. Jetpack Compose Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Stable vs Unstable Parameters” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Jetpack Compose Academy lesson?

Yes. Every Jetpack Compose Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Stable vs Unstable Parameters
  2. Skipping, @Stable & @Immutable
  3. Deferring State Reads
  4. Layout Inspector & Recomposition Counts
← Back to Jetpack Compose Academy