Where to hoist that state in Compose?
summary
Recommendation: hoist UI state only as high as the logic that reads or writes it requires — keep simple UI-only toggles inside composables, lift scroll state to the lowest common ancestor so a JumpToBottom button and the input field can call LazyList APIs, extract complex UI logic into a plain state-holder class, and move business-producing state to a ViewModel so inputMessage survives rotations and suggestions stream via MutableStateFlow and defaults like rememberLazyListState maintain stability. lowest common ancestor
AI-written summary · about
chapters (6)
related talks
43mHosting our states in Compose
44mState in Jetpack Compose
40mMaking Large Screens Easier in Compose
40mRethinking UI: Imperative to Declarative
42mJetpack Compose: Art of the State
45mMastering Recomposition: Optimizing State Changes for Efficient UI
11mInvest in Real State: A workshop for State in Compose
37mPeeling Back the Layers: Unmasking the UI-nknown!
