Created
July 14, 2022 22:43
-
-
Save arriolac/8ed5272b37838e67160c0b17fd57eb93 to your computer and use it in GitHub Desktop.
Using key in RV when there is remembered state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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