I was trying to solve a problem where my remember ...
# compose
a
I was trying to solve a problem where my remember {}'d state would get lost when I changed between a 1 and 2 pane view. I thought movableContentOf would help me but it seems movableContentOf doesn't retain your remember state all the time. Not sure what its restrictions are? In my case one path had a Box {} with single child, and the second path had a SubcomposeLayout doing custom layout. Not sure if its the subcomposelayout or different number of parents. ? My current fix is to always do custom layout which solves the problem, but surprised me.
i
What version of Compose are you using? moveableContentOf + SubcomposeLayout only got fixed in Compose 1.3.0-beta03: https://issuetracker.google.com/235398298
a
Ah yes we are currently stuck on 1.2 but moving to 1.3 in a couple weeks, I will check that out
as a followup, we moved to 1.3.1 but instead of remember getting lost when moving into a subcomposelayout, we see a crash. For now we removed out use of moveableContentOf to avoid the problem (though after creating a test project to hit it there are probably multiple things we could change to avoid it) created an issue after getting a small test project simulating what we're doing here: https://issuetracker.google.com/u/1/issues/259767846