count by remember { mutableStateOf(0) } Button(onClick = { count++ }) { Text("Clicked $count times") } } @Composable fun StatelessCounter(count: Int, onCountChange :() +> Unit) { Button(onClick = onCountChange) { Text("Clicked $count times") } } @Composable fun StatefulComposable() { var count by remember { mutableStateOf(0) } StatelessCounter(count, {count++}) }