Skip to content

Commit deb3603

Browse files
committed
Update DynamicSizeExample documentation to clarify handling of overflowed children in React versions; add tip for using renderHiddenItem in React < 19.2.
1 parent 0770291 commit deb3603

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

demo/src/examples/DynamicSizeExample.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ export function DynamicSizeExample() {
8585
<section className="demo">
8686
<h2 id="dynamic-size-example">Changing Item Sizes After Load</h2>
8787
<p>
88-
Simulates skeleton items that start tiny (20px) and expand to their full size (50px) after a short delay—useful
89-
for testing measurements when children resize after initial render.
88+
By default the list temporarily unmounts overflowed children while it measures, so elements that change size
89+
(e.g. skeletons growing from 20px to 50px) can flicker as they re-enter the DOM. React 19.2+ solves this via
90+
<code>React.Activity</code>; in older versions you can pass <code>renderHiddenItem</code> to keep every child
91+
mounted and simply hide the overflowed ones yourself.
9092
</p>
9193

9294
<div className="code-preview">
@@ -108,6 +110,11 @@ export function DynamicSizeExample() {
108110
);
109111
}}
110112
/>
113+
<div className="demo-note" style={{ marginTop: "12px" }}>
114+
<strong>Tip:</strong> In React &lt; 19.2, pass a <code>renderHiddenItem</code> callback like above to keep
115+
custom elements mounted. React 19.2+ users can rely on the built-in <code>React.Activity</code> that the
116+
component uses internally.
117+
</div>
111118
</div>
112119
</section>
113120
);

0 commit comments

Comments
 (0)