Feed Screens Don't Need a List: Paging Room Data into Compose with Paging 3
A big List kills feed performance. Here's how to stream Room data with Paging 3 and LazyColumn, plus the invalidation and placeholder trade-offs you need to know.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
A big List kills feed performance. Here's how to stream Room data with Paging 3 and LazyColumn, plus the invalidation and placeholder trade-offs you need to know.
Room can return a PagingSource directly from a DAO, and Paging 3 handles the incremental loading, diffing, and invalidation. Here's the minimal wiring, the cachedIn gotcha, and how to verify it.
A LazyColumn backed by Paging 3 must supply a key lambda that preserves item identity across recompositions and configuration changes, especially when placeholders are enabled by default. Using the domain ID (key = it.id) works only if the ID is immutable; Paging 3 inserts null placeholders, forcing a null‑safe fallback such as it?.id ?: -position, and Remot