Hi everyone! is it normal than when navigating bet...
# compose
j
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
If it's fetching everytime from network, then it's expected to recompose everytime. But usually you should avoid it.
j
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
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
tried with no key at all (I believe that passes Unit), and then with Unit and still the same 😢
i'll try the new release