Function

invalidateSubtree

Invalidates the subtree of this layout, including layout, drawing, parent data, etc.

invalidateSubtree

Source set: Common
public fun DelegatableNode.invalidateSubtree()

Invalidates the subtree of this layout, including layout, drawing, parent data, etc.

Calling this method can be a relatively expensive operation as it will cause the entire subtree to relayout and redraw instead of just parts that are otherwise invalidated. Its use should be limited to structural changes. 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.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: