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

Mehdi Haghgoo

09/01/2020, 4:51 PM
Do we have stateful Composables as compared to Stateful and Stateless Widgets in Flutter?
s

Stew Boling

09/01/2020, 4:58 PM
Every Composable can be stateful by using remember { mutableStateOf() } or any of the extensions for Coroutines, Rx and LiveData
m

Mehdi Haghgoo

09/01/2020, 5:04 PM
So, if a composable does not remember, it is stateless, right?
s

Stew Boling

09/01/2020, 6:23 PM
Yep
l

Leland Richardson [G]

09/01/2020, 6:28 PM
i’m curious: is that distinction useful to you in some way?
m

Mehdi Haghgoo

09/01/2020, 7:16 PM
@Leland Richardson [G] I'm not really sure how would it benefit me. I watched your recent YouTube video on Compose and it was great, but I don't think you mentioned anything about a composable being stateful or stateless. So, my guess is it does not matter because state is always managed the same way in Compose, right?
l

Leland Richardson [G]

09/01/2020, 7:16 PM
Yeah I view whether it is stateful or not as an implementation detail, so no need to distinguish