Sử dụng use() để đọc Promise/Context linh hoạt bên trong câu lệnh điều kiện if.
Môi trường thực hành:
React v19.2 (Client Sandbox)
ESM CDN · Hot Reload
React Playground
React v19.2
Interactive Client Sandbox · Live Hot Reload
4 files
src/main.tsx
Entry File
Instructions:Thực hành React: Đọc Promise & Context với use() API. Bạn có thể xem cấu trúc index.html, main.tsx và trực tiếp chỉnh sửa component trong src/App.tsx.