Understanding @compose calling
I have the following @composable function:
@Composable
fun MessageCard(msg: Message){
//Elements
}
And have observed that this piece of code :
@Composable
fun Conversation(messages: List) {
LazyColumn {
for(message in messages){
MessageCard(message)
}
}
}
complains about : @Composable invocations can only happen from the context of a @Composable function
While on the other hand,
@Composable
fun Conversation(messages: List) {
LazyColumn {...