luke_c
03/17/2021, 3:26 PMZach Klippenstein (he/him) [MOD]
03/17/2021, 3:37 PMa static CompositionLocal will cause the entire tree below to recompose, which seems worse than always just recomposing the Composable(s) using itExactly, so static locals are intended for when the value will never change, or only change very rarely. E.g. the
Context
is provided via a static local, because the Context
is strongly associated to the entire composition (it’s used to create the android views that host it) and it can never change for a given composition.