0PricingLogin
Jetpack Compose Academy · Lesson

Skipping, @Stable & @Immutable

Mark types so Compose can skip work.

When You Need Annotations

Sometimes a type is truly safe but Compose cannot prove it. Annotations let you promise stability so skipping kicks back in.

The @Immutable Promise

@Immutable tells Compose that once an instance is built, none of its properties will ever change. It is the strongest stability guarantee.

@Immutable
data class Theme(val primary: Long, val radius: Int)

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