We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10ca51d commit 3cc2f50Copy full SHA for 3cc2f50
src/hooks/useHeights.tsx
@@ -33,6 +33,8 @@ export default function useHeights<T>(
33
cancelRaf();
34
35
const doCollect = () => {
36
+ let changed = false;
37
+
38
instanceRef.current.forEach((element, key) => {
39
if (element && element.offsetParent) {
40
const htmlElement = findDOMNode<HTMLElement>(element);
@@ -45,12 +47,15 @@ export default function useHeights<T>(
45
47
46
48
if (heightsRef.current.get(key) !== totalHeight) {
49
heightsRef.current.set(key, totalHeight);
50
+ changed = true;
51
}
52
53
});
54
55
// Always trigger update mark to tell parent that should re-calculate heights when resized
- setUpdatedMark((c) => c + 1);
56
+ if (changed) {
57
+ setUpdatedMark((c) => c + 1);
58
+ }
59
};
60
61
if (sync) {
0 commit comments