In this article, you will learn some of the useful things you should know about Jetpack compose recomposition.
But, what is recomposition in Jetpack Compose?
Recomposition is the process of calling composable again and again on input changes. In the legacy Android View system, we use invalidate() to do the same.
Compose always tries to complete recomposition before it needs to recompose again. If the state change before the previous recomposition finishes, Compose might cancel the ongoing composition and restart it with the new state. A composable function might be run quite frequently, as often as every frame of an animation. Jetpack compose does smart recomposition, which means it skips the composition if the input hasn't changed unlike invalidate() which redraws everything even if it’s not changed.
For detailed list, navigate to our blog to read Jetpack Compose Recomposition.
Top comments (0)