Hello! Why does `Card` not recompose when the `ele...
# compose
z
Hello! Why does
Card
not recompose when the
elevation
is changed?
Copy code
var elevation by remember { mutableIntStateOf(6) }

Card(
    modifier = Modifier.size(width = 240.dp, height = 100.dp),
    elevation = CardDefaults.cardElevation(defaultElevation = elevation.dp)
) {
    Text("Text")
}
j
Sounds like an issue, I had a similar thing happening with animation specs. Have you had the chance to look at the source code?
That was my issue, for reference: https://issuetracker.google.com/issues/286096926
👍🏻 1
z
@Jonas Thanks for the info! I found that using
key(elevation) { Card(...) }
can force recompose the
Card
, which can be a temporary solution