Is it a bad practice to remember `Modifier.clickab...
# compose-android
j
Is it a bad practice to remember
Modifier.clickable(...)
Modifiers? I have a AndroidView which renders a text in a list. when I update the list, even though the text is same, not remembering the modifier triggeres the recomposition, whereas if I remember
Modifier.clickable(...)
, the recomposition is skipped I have never seen any example where modifiers are being remembered hence the confusion. also I noticed the modifiers like
padding
are not causing the same recomposition, but
clickable
does. Can anyone point me in the right direction?
I think this is an existing issue. https://issuetracker.google.com/issues/241154852 should we suppress it by remembering it?
s
I tried remembering the modifier but it is still happening for me (I used the example that guy posted in the issuetracker). I guess they have to recomposition it as they need to apply some effects to the composable (for example clickable applies that darker shadow when you click it). If you look for where that
composed
function is applied you will see all the components that needs to apply some kind of effect to the desired composable