I am missing some methods like componentWillUnmount() or componentDidMount () ๐
๐ 3
j
jim
02/20/2021, 8:22 PM
Those methods encourage people to think of their widgets as having a lifecycle and being a "thing" (instead of being a functional transformation from data->UI), so I'm glad we never had them as first class citizens on a widget class.ย One of the reasons I advocated so hard for composables to be functions was that I didn't want someone to have the bright idea of adding lifecycle methods back in a future version of Compose.
๐ 12
๐ 3
๐ 4
m
mzgreen
02/20/2021, 8:49 PM
Sounds very interesting, would love to read a blog post/watch a talk about this @jim!
a
Arkadii Ivanov
02/20/2021, 8:57 PM
You don't need lifecycle in Composable functions if they are nothing but UI. Same as there is no lifecycle in normal Android Views. ๐
j
julioromano
02/20/2021, 11:09 PM
That looked very React like.
t
Thiago
02/22/2021, 1:52 PM
So, we can't use the name "lifecycle" when using Effects or RememberObserver? They are replacement to old onCommit, onActive, onDispose, etc. Associating they to lifecycle is better to understand, I think.
In some moments we'll need dispose resources created on "enter" and after "exit" a composable function. Is not that a lifecycle?