https://kotlinlang.org logo
#android
Title
# android
e

Eric Womer

10/09/2022, 2:15 PM
And why can't you overload a method and add @Composable to it?
a

Adam Powell

10/09/2022, 3:03 PM
Do you mean override instead of overload?Adding
@Composable
adds hidden parameters to the method signature that the caller of an abstract method doesn't provide. It's these hidden parameters that provide the state about the composable function's current place in the composition
it's the same reason why you can't add
suspend
to a method override when the base class/interface doesn't have it on the method
14 Views