# State, recomposition và state hoisting

> Recomposition, remember và khóa của nó, collectAsStateWithLifecycle, và state hoisting đẩy tới tận cùng như TicTac làm.

- URL: https://dantech.academy/courses/kotlin-mobile-101/02-compose-essentials/lesson-02-state-and-recomposition
- Khóa học: [Kotlin Mobile 101](https://dantech.academy/courses/kotlin-mobile-101.md)
- Module: Compose Fundamentals
- Thời lượng: 12 phút
- Độ khó: beginner
- Truy cập: Dành cho học viên

## Mục tiêu

- Giải thích recomposition và biết remember giữ giá trị qua những lần vẽ lại
- Áp dụng state hoisting để tách composable chỉ hiển thị khỏi composable giữ state

## Nội dung bài học

1. Recomposition: Giao Diện Tự Vẽ Lại
2. remember: Giữ Giá Trị Qua Những Lần Vẽ Lại
3. collectAsStateWithLifecycle: Nối Luồng Dữ Liệu Vào Giao Diện
4. State Hoisting: Đẩy State Lên Trên

## Học cùng AI agent

Toàn bộ bài học dành cho học viên của khóa. Học viên mở bài trên web và bấm nút **Markdown** để copy toàn bài, rồi dán vào Claude, ChatGPT, Cursor hoặc agent bạn đang dùng. Nhanh hơn: tạo token ở `/profile/ai-agents` và agent đọc bài trực tiếp qua MCP.

- [Đăng ký khóa học](https://dantech.academy/kotlin-mobile-101/checkout)

---

- Bài trước: [Composable, layout và Modifier](https://dantech.academy/courses/kotlin-mobile-101/02-compose-essentials/lesson-01-composables-and-layout.md)
- Bài tiếp theo: [Lưới và lựa chọn](https://dantech.academy/courses/kotlin-mobile-101/02-compose-essentials/lesson-03-grid-and-selection.md)
