In Kotlin, function is a first-class citizen. We can store a function in a variable as below
val functionVariable: () -> Unit = ::myFunction
fun myFunction() { }
However, for @Composable function, how can I do so?
If I did the below, it will cry foul i.e. org.jetbrains.kotlin.diagnostics.SimpleDiagnostic@e93b05f8 (error: could not render message)
val functionVariable: () -> Unit = ::myFunction
@Composable
fun myFunction() { }
Is there a way to store composable function as a variable?