Jetpack Compose

Android's recommended modern toolkit for building native UI Use when this capability is needed.

tomevault-io Updated

File contents

Jetpack Compose Skill

Best Practices

  1. State Hoisting: Move state up to the caller to make composables stateless and reusable.
  2. Side Effects: Use LaunchedEffect or DisposableEffect for side effects. Never run them directly in the function body.
  3. Stability: Ensure classes used in params are @Stable or @Immutable to skip unnecessary recompositions.

Common Pitfalls

  • Excessive Recomposition: Reading state too high up or not using keys in LazyColumns.
  • Context: Holding references to Activity Context inside Composables (Leak risk).

References


Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/sami--widgets--jetpack-compose commit 9f8a9ed9b9

Frequently asked questions

npx skillmds@latest add tomevault-io/jetpack-compose