Skip to main content

composable

Attribute Macro composable 

Source
#[composable]
Expand description

Turns a function into a composable: its body runs inside a group keyed by the call site, and recomposition skips it while its arguments are unchanged. #[composable(no_skip)] always re-runs the body and stores no parameters: as Compose’s inline composables, it composes in its caller’s group, where what it composes is matched by position, as a loop’s items are, so a state it or its content reads recomposes the composable that called it.

Composables are named in CamelCase, as in Jetpack Compose, so the generated function carries #[allow(non_snake_case)] and callers need no lint allowance of their own.