State hoisting nghĩa là chuyển state từ composable con lên composable cha, làm cho composable con trở nên stateless.
- Composable stateless nhận state qua tham số và callback để cập nhật state, giúp tái sử dụng trên nhiều màn hình.
Ví dụ hoist state của TextField lên cha để nhiều composable có thể đọc.
State hoisting means moving state from a child composable to its parent, making the child stateless.
- A stateless composable receives state as a parameter and callbacks for state updates, making it reusable across different screens.
- This improves testability, reusability, and makes data flow unidirectional and predictable.