Is everything inside a component’s content lambda ...
# compose
m
Is everything inside a component’s content lambda considered children of a modifier used for that component? Or by a modifier’s children, do we mean other modifiers chained to it?
s
Why are you asking this question, what was the original text that you read say that made you think of this? Besides that, usually the modifier will in fact be applied top level of a composable function, and the content will be called inside of that container, but that's just how it should be, a composable function can also do this wrong, so it wouldn't be the case then. You can just look at the implementation of any composable to see how everything is called though, and see where the modifier is applied and where the content is emitted
m
this question was raised for me because of what this paragraph says, which explains Modifier.animateContentSize() :
<https://developer.android.com/reference/kotlin/androidx/compose/animation/package-summary#(androidx.compose.ui.Modifier).animateContentSize(androidx.compose.animation.core.FiniteAnimationSpec,kotlin.Function2)>
s
Right, then it means anything that is under this modifier. Now what IS under this modifier? If there are any modifiers chained after this, and those somehow add more to the UI, then those count, since the modifier above will affect the modifier below it. And then, when this modifier is applied to some container, say Box, or Column, then this would also count all the contents of those containers as children.