Sử dụng renderHook, act() và test-isolation để kiểm thử các Custom Hooks phức tạp và kiểm tra logic chuyển đổi trạng thái của Zustand Store.
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: Kiểm Thử Custom Hooks & Zustand Store Độc Lập. 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.