-
-
Save skydoves/a34f6b117396d314f8d2888f0e55035e to your computer and use it in GitHub Desktop.
declarative
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 Main() { | |
var count by remember { mutableStateOf(0) } | |
CounterButton(count) { | |
count++ | |
} | |
} | |
@Composable | |
fun CounterButton(count: Int, onClick: () -> Unit) { | |
Button(onClick = onClick) { | |
Text("Clicked: $count") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment