Is it safe to use `mutableStateOf<IntArray>`...
# compose
h
Is it safe to use
mutableStateOf<IntArray>
? Or does this not trigger a new recomposition because
equals
uses the reference?
n
that won’t trigger a new composition if any of the underlying items in the array are changed. If you want to update based on if items change, you can use
mutableStateListOf
instead.
2
a
It will trigger invalidation if a new array is set even with the same values, for the reason you cite: arrays do not implement
equals
to compare contents