diff --git a/packages/next/src/client/components/layout-router.tsx b/packages/next/src/client/components/layout-router.tsx index f88fd59d67e8..a02fe219489d 100644 --- a/packages/next/src/client/components/layout-router.tsx +++ b/packages/next/src/client/components/layout-router.tsx @@ -127,7 +127,7 @@ interface ScrollAndFocusHandlerProps { } class InnerScrollAndFocusHandler extends React.Component { handlePotentialScroll = () => { - // Handle scroll and focus, it's only applied once in the first useEffect that triggers that changed. + // Handle scroll and focus, it's only applied once. const { focusAndScrollRef, segmentPath } = this.props if (focusAndScrollRef.apply) { @@ -192,7 +192,7 @@ class InnerScrollAndFocusHandler extends React.Component { // In case of hash scroll, we only need to scroll the element into view if (hashFragment) { - ;(domNode as HTMLElement).scrollIntoView() + domNode.scrollIntoView() return } @@ -202,7 +202,7 @@ class InnerScrollAndFocusHandler extends React.Component