Hi everyone!
is it normal than when navigating between composables, say have a list/detail model, when i click back the list composable recomposes? as in I click an item on the list, go to the detail, I click the back arrow and the list recomposes.
The reason i think this is happening is because the List compose fetches the items using the
produceState
delegate from the network and it's called every time I go back, is that the expected behavior or something I'm doing wrong?
r
rajesh
06/30/2021, 8:57 AM
If it's fetching everytime from network, then it's expected to recompose everytime. But usually you should avoid it.
j
julioyg
06/30/2021, 9:01 AM
i meant that's fetching from the items because the
produceSate
side effect is executed every time I go back because it recomposes, not the other way around 😅
j
Jorge Castillo
07/03/2021, 9:45 PM
Are you passing any key parameters to produceState that might vary when coming back? produceState() with no key params relies on LaunchedEffect(Unit) and therefore it should span a job across recompositions.
j
julioyg
07/05/2021, 7:45 AM
tried with no key at all (I believe that passes Unit), and then with Unit and still the same 😢