useEffect() định nghĩa hàm componentWillUnmount (ok)
https://viblo.asia/p/su-dung-useeffect-trong-reacthooks-1Je5EPbmlnL
Như chúng ta đã biết thì componentWillUnmount sẽ chạy mỗi khi một component chuẩn bị remove khỏi tree DOM, cùng xét 1 ví dụ:
PrevioususeEffect() sẽ giống hệt với componentDidMountNextCấu trúc React Folder tối ưu, dễ bảo trì, dễ nâng cấp (ok)
Last updated
Was this helpful?