fix(report): defer lazy-section setState so staging lint can pass

IntersectionObserver fallback called setVisible inside useEffect, which the
react-hooks compiler treats as an error. Queue it on rAF so the gate can
publish the MD report page.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-06 22:33:38 +08:00
co-authored by Cursor
parent 809bdf13e9
commit ebc8380fb8
4 changed files with 30 additions and 8 deletions
@@ -77,8 +77,8 @@ function LazyMarkdownSection({
useEffect(() => {
if (visible) return;
if (typeof IntersectionObserver === "undefined") {
setVisible(true);
return;
const frame = requestAnimationFrame(() => setVisible(true));
return () => cancelAnimationFrame(frame);
}
if (!ref.current) return;
const observer = new IntersectionObserver((entries) => {