#8233·blueprint

Text layout effect always setStates and can exceed React 19 update depth

Author: andrewkrippnerCreated Aug 16, 2026Updated Aug 16, 2026

Bug description

Text (packages/core/src/components/text/text.tsx) always calls setState from its overflow-measuring layout effect, even when the derived title has not changed:

useIsomorphicLayoutEffect(() => {
    if (contentMeasuringRef.current?.textContent != null) {
        setIsContentOverflowing(
            ellipsize! && contentMeasuringRef.current.scrollWidth > contentMeasuringRef.current.clientWidth,
        );
        setTextContent(contentMeasuringRef.current.textContent);
    }
}, [contentMeasuringRef, children, ellipsize]);

children is in the dependency array, so any parent that passes a new element identity (menus with HighlightText / EntityTitle, table cells, etc.) re-runs the effect. Under React 19 that nested update path can exceed the update-depth limit (minified error #185) when many Text nodes measure in one commit.

The effect also ignores an explicit title prop while measuring, then overwrites via title ?? …. Callers that pass title still pay the scrollWidth reflow.

Steps to reproduce

  1. Use @blueprintjs/core 6.18.0 (also current develop) with React 19.
  2. Render a dense Menu / EntityTitle / table whose item labels go through Text ellipsize and whose children identity changes across parent renders.
  3. The tree crashes with "Maximum update depth exceeded".

Suggested fix

Store a single derived overflow title. Only setState when that string actually changes. If the caller passed title, skip measuring and do not keep an auto title.

Environment

  • @blueprintjs/core 6.18.0 (confirmed on develop HEAD)
  • React 19