https://kotlinlang.org logo
#compose
Title
# compose
h

hfhbd

05/09/2022, 8:17 AM
Is is possible to get a CompositionLocalValue for a specific keyed group? • key(root) -- CompositionLocalProvider provides 1 --- key(foo) --- same CompositionLocalProvider provides 42 I would like to the value 1 from a Composable inside the key foo.
z

Zach Klippenstein (he/him) [MOD]

05/10/2022, 3:15 PM
No, this is not supported. You can provide a composition local that explicitly includes the “parent” value. But I'd also be cautious about building too much on composition locals in the first place.
h

hfhbd

05/10/2022, 3:19 PM
Thanks. I thought I could (mis-) use Compose's tree as a "storage" during creating.
2 Views