Menu

remember vs rememberSaveable in Jetpack Compose: When to Use Each
📰

remember vs rememberSaveable in Jetpack Compose: When to Use Each

DEV Community: kotlin·Tech Stack·about 7 hours ago
#ApGPU3B1
Long article (536 words) — no AI summary yet.
Reading 0:00
15s threshold

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, backgrounded, or process-killed by the system. Picking the wrong one is a common source of "why did my state just disappear" bugs.

Quick Comparison

Aspect remember rememberSaveable

Survives recomposition Yes Yes

Survives configuration change (rotation) No Yes

Survives process death + restore No Yes, in most cases

Requires a saveable type No Yes, Parcelable/primitive or a custom Saver

What remember Actually Does

remember stores a value in the Composition - the in-memory tree Compose builds to describe your UI.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.