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

galex

03/30/2023, 8:46 AM
Can we have a modifier that sets a CompositionLocal for the scope of the composable? How can I achieve something like that?
🤔 1
Trying to not have an extra level of indentation per set of a CompositionLocal, if that can make any sense...
e

ephemient

03/30/2023, 9:50 AM
I don't think it makes much sense. a hypothetical modifier can't affect reads early enough for
Copy code
Modifier.locals(LocalContentColor to ...).background(LocalContentColor.current)
to work
g

galex

03/30/2023, 9:52 AM
Thanks 👍
6 Views