Runtime 4 min read

Compose Runtime 1.13.0-rc01: Read-Only computedStateOf, NaN Skipping Fix and the State Leak Fixes Worth Knowing

Compose Runtime 1.13.0-rc01 is listed on Nov 4, 2026 with a single change: a dependency bump of androidx.tracing:tracing-wire to 2.0.5. The substance of 1.13 is in the beta notes before it, and since the RC freezes the API surface, this is the moment to check your code. Everything here comes from the official Compose Runtime release notes, fetched today. Stable 1.13.0 is not listed yet; the current stable is 1.12.1.

rc01
Nov 4, 2026: tracing-wire 2.0.5 only
Kotlin 2.2
required since 1.13.0-beta01
1.12.1
current stable runtime

1. Kotlin 2.2 is the entry ticket

1.13.0-beta01 (Oct 7, 2026) moved the libraries to target Kotlin 2.2 and require kotlinc 2.2. If your build is still on an older Kotlin toolchain, that upgrade comes before anything else, and it is the most likely reason a bump to the RC fails to compile.

2. The computedStateOf block is now read-only

The notes call this a behavior change: the computedStateOf calculation block is read-only, and writing to a state inside it throws an IllegalStateException. The same discipline has always applied to derivedStateOf; the new enforcement makes the failure loud instead of a source of subtle invalidation loops. The pattern to remove looks like this:

var lastSeenMax by mutableIntStateOf(0)

// Smell: side effect inside a calculation block
val isNearEnd by remember {
    derivedStateOf {
        val idx = listState.firstVisibleItemIndex
        lastSeenMax = maxOf(lastSeenMax, idx) // write inside a derived calculation
        idx >= itemCount - 3
    }
}

// Fix: keep the calculation pure, record the side effect separately
val isNearEnd by remember {
    derivedStateOf { listState.firstVisibleItemIndex >= itemCount - 3 }
}
LaunchedEffect(listState) {
    snapshotFlow { listState.firstVisibleItemIndex }
        .collect { lastSeenMax = maxOf(lastSeenMax, it) }
}

Watch out: the release note names computedStateOf specifically. I could not verify from the notes that derivedStateOf got the same enforcement, so treat the snippet above as a hygiene fix, not a claim about derivedStateOf behavior.

3. NaN no longer defeats skipping

Passing Float.NaN or Double.NaN into a @Composable function used to prevent it from skipping recomposition, because NaN does not equal itself. The notes say this affected functions receiving Dp.Unspecified, which is common in layout and animation parameters. beta01 fixes it, so composables with unspecified dimension defaults can now skip as expected. If you worked around this by adding manual guards or remember wrappers, they can be removed after you measure.

@Composable
fun Thumb(size: Dp = Dp.Unspecified, modifier: Modifier = Modifier) {
    // Before the fix, an unchanged Dp.Unspecified argument could still force recomposition
    Box(modifier.then(if (size.isSpecified) Modifier.size(size) else Modifier))
}

4. Leaks and invalidation bugs fixed

If your heap dumps show retained state values behind long-lived screens, these are worth reading against your LeakCanary traces before blaming your own code.

5. Observer and tracing changes

Upgrade checklist

  1. Confirm the toolchain is on Kotlin 2.2 before touching the Compose BOM.
  2. Search for state writes inside derivedStateOf and computedStateOf blocks and move them to effects.
  3. Remove NaN or Dp.Unspecified workarounds only after re-measuring recomposition counts.
  4. If you implement a CompositionObserver, re-test anything that assumed mid-pass observer swaps.
  5. Re-run leak checks on screens using movableContent.

An RC with a one-line change is a gift: nothing moves between now and 1.13.0 stable except what you fix. The read-only enforcement is the item most likely to surface in your own code.

Source: Compose Runtime release notes (1.12.0-beta01 through 1.13.0-rc01) and the AndroidX release index, developer.android.com, retrieved Nov 17, 2026.

Comments 0

No comments yet. Be the first to leave one!

Leave a comment