Akhil Jain
07/22/2022, 10:52 AMAudioWidgetItem
and I am passing a lambda onPostClicked
in it. Now when I am invoking this lambda on line 149
then this function is getting recomposed again and again on some action (even though hash code of this lambda is coming same as printed in line 144
).
But when I am commenting out this lambda invocation at line 149
then unnecessary recomposition of this function doesn't happen.
I am not able to understand the reason behind this behaviourStylianos Gakis
07/22/2022, 10:42 PMAkhil Jain
07/24/2022, 5:09 PMAudioWidgetItem
and onPostClicked
then problems solvesStylianos Gakis
07/24/2022, 5:13 PMJsonElement
was not Stable. Is that from kotlinx.serialization?
Also did you need to make onPostClicked stable too? I actually don’t know if lambda functions are inferred as stable or not.Akhil Jain
07/24/2022, 5:23 PMgson
Not sure if we can make lambdas as stable. I had to use remember block with lambda to keep its instance same or it'll create different hashcode each time if I use it directlynatario1
07/24/2022, 5:26 PM