The Composable lifecycle 🍂
And how it maps to their host Android lifecycle
We are very used to lifecycles in Android. We know about the lifecycle of Activities and Fragments, having consulted those diagrams more than a thousand times. We are also familiar with the
View lifecycle, and how it fits within the one of their host
Fragment. Let’s learn now about the lifecycle of Composables.
Things covered in this article:
We’ll learn to differentiate between the process of initial composition, recomposition/s, and the Composition.
The Composable lifecycle. Its different events.
When those events take place within the context of a Composition.
How the Composable lifecycle fits within the one of its host
How to delimit effects by the lifecycle of a Composable.
How the runtime identifies Composables in order to manage their lifecycle coherently across recompositions.
Let’s go for it 👇