to clarify, of course I have an implementation elsewhere, like: ```class CustomImageLoader : ImageLo...
c
to clarify, of course I have an implementation elsewhere, like:
Copy code
class CustomImageLoader : ImageLoader {
  @Composable
  override fun Image(url: String) {
    // Load and draw the image
  }
}
s
This is a class based composable, which we used to ship.
It was removed because the list of rules about what you can update and when are decidedly not class-like. You can make it work however, if you remember that the implicit
this
pointer is a parameter to
Image
If you do go down this route, to make it easy, I'd suggest making all members
State<T>
The mapping to make it work correctly: ctor args -> composable parameters class members -> hoisted state to a composable local remember -> composable state Note that class members in this structure are not equivalent to local state, as they may be shared with multiple invocations (instances) of
Image
c
Thanks for the info. My intention is not to use class member state in the Composable, but just to hide implementation detail / external dependencies
s
It's fine to use it for namespacing like this, though also consider using an
object
so people are less likely to add state to the object.
c
good idea! I think I could do that