Having a composable A which is a Column, If you cr...
# compose
p
Having a composable A which is a Column, If you create a composable B with three Text elements, and these Texts are not in a column in the composable B, is an acceptable approach to not wrap the 3 Texts into a column because you are going to use the composable B into a composable with a Column? or is preferable to wrap them into a Column even if you are going to put that composable into another composable with a Column?
c
pass the
ColumnScope
to the Composable so its clear its context is a
Column
i.e.
Copy code
@Composable
fun ColumnScope.MyTexts() {}
you will also need it if you want to apply Column specific modifiers to your Text composables
p
is not preferable to simply wrap the texts into another column?
for simplicity
c
but why would you need the parent column then?
p
yes, in the parent there are more items
other buttons, other panels, etc...
I'm just reorganizing them in groups
to reduce the function size
c
then do whatever you prefer. I’d go with the ColumnScope approach. 🤷🏼
p
thank you