invalidateMeasurementForSubtree

Function

Common
fun DelegatableNode.invalidateMeasurementForSubtree()

Invalidates measurements for the entire subtree of this node.

Note that invalidateMeasurement is preferable in most cases, however it is only guaranteed to invalidate measurement for that specific node, and it is possible that layout nodes that are underneath it could be cached and thus their measure policies will not get re-executed. Use this API if you need to ensure that measure is called for all layout nodes below this one. This might be necessary in certain situations where you are updating some data which you know descendant nodes use, but you are not relaying on automatic snapshot observation through androidx.compose.runtime.MutableState.

Calling this method can be a relatively expensive operation as it will cause the entire subtree to relayout instead of just parts that are otherwise invalidated. invalidateMeasurement is preferable in most cases, and this should only be used when absolutely necessary.