# Graduating from View IDs

DevFeed: [Graduating from View IDs](<https://devfeed.tech/articles/graduating-from-view-ids-29028.md>)

Original publisher: [Read original article](<https://saket.me/graduating-from-view-ids/>)

Author: Saket Narayan

Published: 2021-12-02T08:55:21Z

Content type: opinion

Language: en

Sources: [Saket Narayan](<https://devfeed.tech/sources/saket-narayan.md>)

Topics: [Compose](<https://devfeed.tech/topics/compose.md>), [ui](<https://devfeed.tech/topics/ui.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-ui](<https://devfeed.tech/tags/compose-ui.md>), [history](<https://devfeed.tech/tags/history.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [screen](<https://devfeed.tech/tags/screen.md>), [state](<https://devfeed.tech/tags/state.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

The article argues that Compose UI reduces the need to assign and maintain View IDs for state restoration. It contrasts this with traditional layouts, where missing IDs can prevent scroll position from surviving configuration changes, and explains that Compose can generate stable keys based on code location and handle state restoration automatically in many cases.

## Source excerpt

I found an old screen in Cash App today that wasn't retaining its scroll position across configuration changes. A peek into git history revealed that the author forgot to assign an ID to its scrollable layout for enabling state restoration. And would you even blame them? Sure, View IDs are necessary, but maintaining them manually [...] The post Graduating from View IDs appeared first on Saket Narayan.