Tash
07/18/2022, 5:22 PMclass FooView : AbstractComposeView {
// Consumers can set click listener
// Does this need to be a mutable state?
val clickListenerState: MutableState<() -> Unit> = mutableStateOf({})
// Or does this suffice?
var clickListenerNotState: () -> Unit = {}
@Composable
override fun Content() {
Button(
onClick = clickListenerNotState // OR clickListenerState.value
)
}
}
Zach Klippenstein (he/him) [MOD]
07/18/2022, 5:29 PMTash
07/18/2022, 5:53 PMFooView
was inflated and didn’t try with subsequent changes to it (oh Mondays). Thanks for the sanity check 😅!Zach Klippenstein (he/him) [MOD]
07/18/2022, 6:03 PM