Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/hooks/useHeights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export default function useHeights<T>(
cancelRaf();

const doCollect = () => {
let changed = false;

instanceRef.current.forEach((element, key) => {
if (element && element.offsetParent) {
const htmlElement = findDOMNode<HTMLElement>(element);
Expand All @@ -45,12 +47,15 @@ export default function useHeights<T>(

if (heightsRef.current.get(key) !== totalHeight) {
heightsRef.current.set(key, totalHeight);
changed = true;
}
}
});

// Always trigger update mark to tell parent that should re-calculate heights when resized
setUpdatedMark((c) => c + 1);
if (changed) {
setUpdatedMark((c) => c + 1);
}
};

if (sync) {
Expand Down
Loading