Junior — Middle
How often is the reorganization of a function using a Stable parameter performed when working with Jetpack Compose?
sobes.tech AI
Answer from AI
In Jetpack Compose, a function that uses a parameter annotated with @Stable reorganizes only when the value of that parameter changes. The @Stable annotation informs the compiler that the object changes predictably and its internal state does not change without the reference changing. This allows Compose to optimize re-rendering and avoid unnecessary function calls.
Thus, reorganization occurs not on every call, but only when the stable parameter changes, which improves UI performance.