Thiết kế kiến trúc một app React Native tốt bao gồm tổ chức code, tách biệt mối quan tâm (UI, logic, dữ liệu), chọn quản lý state, và cấu trúc cho khả năng bảo trì, test được, và mở rộng. Kiến trúc tốt quan trọng khi app lớn lên.
Tổ chức project
Tổ chức code theo FEATURE hoặc theo TYPE (theo feature mở rộng tốt hơn cho app lớn):
src/features/auth/{components, screens, hooks, api, store}/ (theo feature)
HOẶC src/{components, screens, hooks, services, store, navigation, utils}/ (theo type)
→ Giữ code liên quan với nhau; tách code tái sử dụng khỏi code đặc thù feature.
