I have seen some standard composables such as `Row...
# compose
d
I have seen some standard composables such as
Row
or
Column
are defined as
inline
. What is the purpose? and does it ever make sense for custom composables to be defined as inline?
z
From what I’ve heard, the main reason those are inline are because inline composables don’t have a recompose scope (they’re inline, so they just share their caller’s scope), which means they also avoid the extra bookkeeping that goes along with recompose scopes. And because these composables are fundamental building blocks, used absolutely everywhere, avoiding recompose scopes for them has a significant performance benefit.
So it’s probably not going to matter too much for custom composables, unless you’ve done benchmarking and profiling and determined that that particular issue is causing performance to degrade.
👍 1
1
a
Exactly, Row and Column benefit because they're often subject to deeper nesting for layout control reasons, and people naturally factor out semantic composables consisting of them that host the appropriate recompose scopes