Continuous re-render thường do reference instability hoặc missing dependency — dùng DevTools Profiler để identify.
- React DevTools Profiler: tìm component render nhiều.
- Nguyên nhân phổ biến: tạo object/array mới trong render, missing dependency array useEffect, context value thay đổi.
- Fix: React.memo, useMemo/useCallback, split context, move state xuống component con.
Debug and fix continuously re-rendering components:
- React DevTools Profiler: find which component renders excessively.
- Common causes: creating new objects/arrays inline during render, missing useEffect dependency array, context value changing.
- Fixes: React.memo, useMemo/useCallback, split the context, or move state down to a child component.