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

Davide Giuseppe Farella

08/26/2020, 4:25 PM
It might be a dumb question, but as I’m at my very beginning with Compose and cannot find an answer. Given I want to have something like
Text(text = myCustomText)
, where
myCustomText: Flow<String>
, what is the cleanest way to deal with that?
v

Vinay Gaba

08/26/2020, 4:26 PM
Compose comes with a
collectAsState
extension function to convert a
Flow
to a
MutableState
d

Davide Giuseppe Farella

08/26/2020, 4:28 PM
Awesome! Thank you! 🙂
👍🏼 1
Am I missing something?
j

John O'Reilly

08/26/2020, 4:36 PM
there's issue I believe with auto importing those.....you might need to manually add imports e.g.
Copy code
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
1
d

Davide Giuseppe Farella

08/26/2020, 4:36 PM
Ouch, that’s a tricky one 😛 Thank you again 🙏
2 Views