Justin Xu
06/11/2023, 10:07 PMSnapshotStateMap state variable and a regular Map that is generated from the state map, then provided to a Composable as follows:
val stateMap: SnapShotStateMap<...> = remember { mutableStateMapOf() }
val anotherMap: Map<...> = stateMap.map { ... }
...
DisplayMapComposable(
map = anotherMap,
changeStateMap = { // Change stateMap in some way }
)
When changeMap is called inside the DisplayMapComposable and modifies stateMap , will it trigger a recomposition of the DisplayMapComposable itself?Zach Klippenstein (he/him) [MOD]
06/12/2023, 1:37 AM.map on the state map that is a read, so that is what will get recomposed.Justin Xu
06/12/2023, 3:13 AManotherMap will get recomposed, but that won't trigger a recomposition on DisplayMapComposable?Stylianos Gakis
06/12/2023, 6:33 AManotherMap and it changes, then yeah it should recompose, why wouldn't it?