Why is Paging3's LoadState and LoadStates not mark...
# compose
v
Why is Paging3's LoadState and LoadStates not marked @Stable or @immutable, even when it only has
vals
and no mutable property After generating Compose Compiler report I can see that its marked as Unstable
Copy code
unstable loadState: LoadStates? = @static null
I have this Crossfade, which keeps recomposing even when the instance is not changed
Copy code
Crossfade(targetState = loadState?.refresh) {... }
a
is it a data class?
does it contain unstable classes (list etc)?
v
It's Paging3's LoadState and LoadStates class
a
both Error and Loading are classes, not data classes
they might be new instances every time
not sure about that though, just looked at the manual
what are you doing with that crossfade? Whats the goal?
v
Based on the loadState, i show loader state, error state or a LazyColumn
Every time I scroll the list even by a very very small amount, The crossfade recomposes
a
did you use the jetpack compose paging library or the regular one?
v
The loadStates come from androidx.paging
a
you should include the paging-compose artifacts too, they add some classes and functions that make paging compatible with jetpack compose
v
rememberAsLazyPagingItem() come from cash app paging, which is a typealias to androidx on android
a
are you using kmp?
v
Yes
a
kk