Erlan Amanatov
05/18/2023, 4:49 AMBoxWithConstraints
• Box
with Modifier.onSizeChanged{...}
When to use which one? What is better for performance?Pablichjenkov
05/18/2023, 5:16 AMLoney Chou
05/18/2023, 7:25 AMModifier.onSizeChanged
. Otherwise, use BoxWithConstraints
. The latter one, however, comes with performance penalty. You could also change the content in those modifier callbacks, this way it would trigger another recomposition, which sometimes is not a good thing.Albert Chang
05/18/2023, 7:29 AMAlbert Chang
05/18/2023, 7:31 AMBut you could also change the content in those modifier callbacks, this way it would trigger another recomposition, which sometimes is not a good thing.It's always bad. See this thread.
Loney Chou
05/18/2023, 7:32 AMLoney Chou
05/18/2023, 7:43 AM