Skip to content

Instantly share code, notes, and snippets.

@arriolac
Created July 14, 2022 22:43
Show Gist options
  • Save arriolac/8ed5272b37838e67160c0b17fd57eb93 to your computer and use it in GitHub Desktop.
Save arriolac/8ed5272b37838e67160c0b17fd57eb93 to your computer and use it in GitHub Desktop.
Using key in RV when there is remembered state
// Copyright 2022 Google LLC.
// SPDX-License-Identifier: Apache-2.0
@Composable
fun ItemRow(index: Int) {
Column(Modifier.fillMaxWidth()) {
Text("Row #${index + 1}", Modifier.padding(horizontal = 8.dp))
key(index) {
LazyRow {
// ...
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment