I know its not possible to call composable functions inside onClick. @Composable invocations can only happen from the context of a @Composable function
Compose version - alpha06
But I'm stuck with the below requirement. The requirement is, Call a server api call inside an onClick.
LazyColumnFor(items = list) { reports ->
Box(Modifier.clickable(
onClick = {
//API call
val liveDataReportsDetails =
viewModel.getReportDetails("xxxx")
LiveDataComponentForReportsDetails(liveDataReportsDetails)
}
)) {
ReportListItem(
item = reports
)
}
}