Is it possible to do a visual transform without tr...
# compose
b
Is it possible to do a visual transform without triggering a recomposition? E.g. say I want to use
Box(Modifier.offset(x=x, y=y)) { Content() }
but update x and y very frequently, while the contents of the box never changes. Right now I see the content get recomposed often, any way to avoid that? Is that in "future optimization" territory?
a
yes, the variant of offset that takes a lambda, like
Box(Modifier.offset { IntOffset(x, y) })
exists specifically to avoid unnecessary recompositions
👍 1
🙏 6
b
Awesome! I actually saw that in autocomplete and was like "why would this take a lambda? that's weird" 🤦‍♂️