til
TIL: Nov 11
tilengineering
TIL: When using IntersectionObserver to lazy-mount components like video players in React, avoid triggering setState synchronously within useEffect to prevent ESLint "set-state-in-effect" warnings; instead, initialize state lazily or use ref-based logic to manage mount triggers. Additionally, when optimizing LCP for grid layouts, ensure loading="eager" is applied to all grid items rendered above the fold rather than just the first index to avoid Next.js image performance warnings.