Created
July 29, 2023 00:12
-
-
Save phatnhse/0bf18343b15ace56bbf3f77956124cd8 to your computer and use it in GitHub Desktop.
jc-sample-row
This file contains 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
@Composable | |
fun Sample() { | |
var button1 by remember { mutableStateOf("button 1") } | |
var button2 by remember { mutableStateOf("button 2") } | |
Column(horizontalAlignment = Alignment.CenterHorizontally) { | |
Button(onClick = { button1 += "1" }) { Text(text = button1) } | |
Spacer(modifier = Modifier.height(8.dp)) | |
Button(onClick = { button2 += "2" }) { Text(text = button2) } | |
// New row added here, expected to recompose when button1 changes. | |
Row { | |
Text(text = button1) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment