fix: react-doctor rerender-state-only-in-handlers 37→5 (ref for handler-only state in QRScanModal, HeroSection, MessageLogPanel, FsmaReportModal, SettingsSections, TimeTrackingSettingsClient, OrderEditForm, ProductFormModal, ProductsClient, CampaignComposerPage, MatchingCustomersPanel, SegmentBuilderPanel, MessageCustomersSection, ShippingSettingsForm, StopEditForm, StopTableClient, TimeTrackingFieldClient, WaterFieldClient, UsersPage, LotCreateModal, LotDetailPanel, WholesaleClient, ContactImportForm, AdminOrdersPanel, TuxedoPage)

This commit is contained in:
Nora
2026-06-26 07:10:42 -06:00
parent ce2dc8f070
commit ad0a0fe4ec
20 changed files with 161 additions and 181 deletions
+2 -8
View File
@@ -24,18 +24,12 @@ export default function HeroSection() {
const containerRef = useRef<HTMLDivElement>(null);
const heroRef = useRef<HTMLElement>(null);
const contentRef = useRef<HTMLDivElement>(null);
const [mounted, setMounted] = useState(false);
const [scrollProgress, setScrollProgress] = useState(0);
useEffect(() => {
const timer = setTimeout(() => setMounted(true), 100);
return () => clearTimeout(timer);
}, []);
// ─── GSAP SCROLL ANIMATIONS ────────────────────────────────────────────────
// Resilient: respects reduced-motion, safe GSAP target checks, reliable counter impl, proper scope
useEffect(() => {
if (!mounted || !heroRef.current || !contentRef.current) return;
if (!heroRef.current || !contentRef.current) return;
const prefersReducedMotion =
typeof window !== "undefined" &&
@@ -232,7 +226,7 @@ export default function HeroSection() {
}, containerRef);
return () => ctx.revert();
}, [mounted]);
}, []);
return (
<>