From 178a155eae4a4a3b6ab45d94e5c6728cbdc9e7e7 Mon Sep 17 00:00:00 2001 From: Johannes Schickling Date: Wed, 30 Mar 2022 14:23:01 +0000 Subject: [PATCH] fix: Prevent page to scroll to top during data HMR --- packages/next/client/next-dev.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/next/client/next-dev.js b/packages/next/client/next-dev.js index d3e4ad7c5754..a98a45213902 100644 --- a/packages/next/client/next-dev.js +++ b/packages/next/client/next-dev.js @@ -87,7 +87,8 @@ initialize({ webpackHMR }) new URLSearchParams(location.search) ) ), - router.asPath + router.asPath, + { scroll: false } ) .finally(clearIndicator) }