- Get link
- X
- Other Apps
1. Leverage Stable and Immutable Types Annotate your data models with @Stable or @Immutable . Prefer using primitive types and immutable data classes in composable parameters. Avoid passing mutable or non-observable types as parameters. 2. Keep Composables Small and Focused Break down large composable functions into smaller, single-responsibility components. This lets Compose (and the compiler) minimize the scope of recompositions. 3. Use remember and rememberSaveable Properly Use remember to store objects or state that should persist across recompositions. Use rememberSaveable for state that must survive process death (with types supported by Bundle). Avoid initializing objects or expensive computations directly in composables—use remember to cache them. 4. Avoid Unstable Objects in Parameters Don’t pass new objects, collections, or lambdas directly as parameter...