composable class instead of functions

Viewed 430

I am new in jetpack compose, is it good practice to use class instead of function in jetpack compose?

class Component{
   fun doSomeThing(){

   }
   @Composable
   fun render(){ 
     Text("Hello")
   }
}
@Composable
fun Component(
   doSomething:() -> Unit
){

   Text("Hello")
 
}
0 Answers
Related