diff --git a/packages/next/client/link.tsx b/packages/next/client/link.tsx index 833f34061a8ee..ebc3990554c58 100644 --- a/packages/next/client/link.tsx +++ b/packages/next/client/link.tsx @@ -113,16 +113,13 @@ class Link extends Component { cleanUpListeners = () => {} - componentDidMount() { - this.cleanUpListeners = () => {} - } - componentWillUnmount() { this.cleanUpListeners() } handleRef(ref: Element) { if (this.props.prefetch && IntersectionObserver && ref && ref.tagName) { + this.cleanUpListeners() this.cleanUpListeners = listenToIntersections(ref, () => { this.prefetch() })