RootCauseunvalidated
You depend on `router.asPath`, so every route change destroys & recreates the observer. — The callback fires very frequently. Tension: Even with the `prev !== newId` check, you're still calling `setState` inside an observer callback that runs on every scroll event → many re-renders. Outcome: The `IntersectionObserver` is recreated too often.
71f29295-fe05-4f22-aa65-a4124763e93a
You depend on router.asPath, so every route change destroys & recreates the observer. — The callback fires very frequently. Tension: Even with the prev !== newId check, you're still calling setState inside an observer callback that runs on every scroll event → many re-renders. Outcome: The IntersectionObserver is recreated too often.