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

Vladimir Ivanov

06/11/2019, 12:22 PM
How do I access android Context in the Composable? Or I should pass all such code as properties?
a

Andrey Kulikov

06/11/2019, 12:31 PM
ideally you don't have a Context here. only the state to be displayed is passed into the composable functions and callbacks needed to be executed when the state change should be triggered by user action
3
l

Leland Richardson [G]

06/11/2019, 7:55 PM
we have an ambient context you can grab if you need it. ideally it’s not needed very often, but right now there are some things that will require it that we haven’t really addressed yet
i think it’s either
AmbientContext
or
ContextAmbient
, i forget. but let us know what you run into that requires it in case it’s something that we’ve already built an alternative way to do it or if it’s something we haven’t thought of yet
2 Views