Strong skipping mode

Jetpack Compose Senior Kotlin 2.0.20+ API 23+ Reviewed By Best Latest Apps

Predict the output

Strong skipping is on. The parent recomposes and passes the same Settings instance (an unstable class with a var). Is the child skipped?

class Settings(var darkMode: Boolean)

@Composable
fun SettingsRow(settings: Settings) {
    Text(if (settings.darkMode) "Dark" else "Light")
}
Options
Hint 1 of 1

How does strong skipping compare unstable values?

Choose an answer, then open Show answer below to check it.

Show answer

Answer: A Yes: the same instance passes the === check

Correct. Strong skipping compares unstable parameters by instance.

Why not the others?
  • B No: unstable parameters always recompose. That was true before strong skipping.
  • C No: classes with var are never skipped. Instance equality is enough under strong skipping.
  • D Yes, but only if annotated @Stable. No annotation is needed for the same instance.

30-second answer

Strong skipping lets Compose skip composables even when they have unstable parameters: unstable values are compared by instance (===), stable ones by equals. It also remembers lambdas automatically, keyed on what they capture. It became the default with the Kotlin 2.0.20 Compose compiler, so many old stability tricks are no longer needed.

Practise saying it · 30 s. No recording, just a timer

Explain strong skipping.

Say your answer out loud, then check which of these points you covered:

  • Skips with unstable params via ===
  • Remembers lambdas
  • Default since Kotlin 2.0.20
  • New instances still recompose

Deep dive

Before it, a composable with any unstable parameter could never be skipped.

A new list instance per recomposition still forces recomposition, so remembering derived values still matters.

You can opt a composable out with @NonSkippableComposable, or a lambda with @DontMemoize.

Stability annotations and the stability config file are still useful for types from other modules.

Common mistakes

  • Saying unstable parameters always prevent skipping, which was the old behaviour.
  • Assuming strong skipping compares lists by contents.
  • Removing every remember around derived values.

Senior take & follow-ups

Knowing the default changed in Kotlin 2.0.20 is a current-knowledge signal interviewers look for.

Follow-up questions

Think of your answer first, then open the hint.

  1. How are lambdas handled now?

    Show hint

    Remembered automatically with their captures as keys.

  2. What still needs a stability config?

    Show hint

    Classes from modules not compiled with Compose that you know are immutable.

Suggest a fix if something here is wrong or out of date.