i want to learn about composition and recompositio...
# compose
t
i want to learn about composition and recomposition in depth .i know that compose first compose everything then any state change triggers recomposition etc etc but what i want to learn is how exactly they're triggered how recompositions are handled (like say compose skips some recomposition) the purpose is i want to know more about this topic so i can leverage it's benifits. moreover i find it tricky to understand recompositions while using multiple Stateflows animation api in a composable. So could anyone mention any good resources ps: i am new to android
s
You don't need to know the implementation details of recomposition to make good use of it; but it's definitely useful to learn the conceptual parts and avoid some common pitfalls. The Android documentation for Jetpack Compose covers everything you need to know about state management, performance, and more. Check it out here: https://developer.android.com/develop/ui/compose/documentation
Another small tip: measure then optimize. As long as you understand how to use state properly (which isn't hard once you get it), Compose is pretty smart about optimizing your code, and will usually perform perfectly fine even if you don't do things optimally. Only start looking into the deeper trenches of "argument stability" and other areas when you actually notice performance issues. Premature optimization is just a waste of time. And yeah, feel free to ask about anything you don't understand or struggle with in this channel!
And if you wanna dive real deep (see how Compose is implemented under-the-hood), make sure to check out Jorge Castillo's Jetpack Compose Internals book. While advanced and not particularly useful from an app developer perspective, it's still a great read if that interests you.
t
thanks 👍🏻
kodee loving 1
z
There are lots of talks on droidcon.com that cover these compose basics too
👍 1
t
i'll check out