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 Activity or 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
ActivityorFragment.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 π

