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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user