I have a question about how to deal with state in an
AdapterList
. If I have actions in the individual row items that should update the view state, I’ve found that using a
MutableState
for the individual row views does not work. I’m guessing this is because even if the row view tries to set its state it still needs the state of the AdapterList to update in order to trigger the recomposition. My question then, is how should the state be updated for the
AdapterList
? In the
itemCallback
of
AdapterList
we only get the item passed to the lambda, not an index. Is it safe to grab the index of the item from within the
itemCallback
to update the list state?
Brian Gardner
03/18/2020, 1:43 PM
Here’s the code with my current spike branch. I tried moving the state up to the