0Pricing
Android Academy · Lesson

State Hoisting

Lift state up for reusable composables.

What Is State Hoisting?

State hoisting means moving state up out of a composable to its caller. The composable becomes stateless: it just receives a value and reports changes.

Stateful vs Stateless

A stateful composable owns its state with remember. A stateless one holds no state; it takes the value as a parameter and exposes an event. Stateless composables are easier to reuse and test.

All lessons in this course

  1. State with remember and mutableStateOf
  2. Recomposition Explained
  3. State Hoisting
  4. rememberSaveable
← Back to Android Academy