Capture Products Visible in Viewport When User Stops Scrolling — React
Implement the same viewport-capture feature as the Vanilla JS version but built as a React component or custom hook. Detect when the user stops scrolling using a debounced scroll listener, then check which product card elements are visible in the viewport using the Intersection Observer API or getBoundingClientRect. Log or display the visible product identifiers for tracking. Design it to be reusable and extensible like a library.