```open class A( open val a: Int, val b: S...
# compose
c
Copy code
open class A(
    open val a: Int,
    val b: String = "Something"
)

data class B(
    override val a: Int = 20,
    val c: Int = 30
) : A(a)
I have a composable which is dependant upon
class B
.
Copy code
@Composable
fun BCard(b: B) {
    // Compose something
}
BCard
recomposes when
a
nad
c
are changed, but not when
b
is changed. How can I solve this?
1
m
I'm not sure i get what you are asking here. Your composable depends on an instance of B, so if that's a state value, the card will recompose when you re-assign it:
Copy code
val b = remember { mutableStateOf(B()) }

BCard(b)
and then at some later point in an onClick callback or something:
Copy code
b.value = b.value.copy(a = 50)
That should trigger recomposition of your card.