Files
cloudflare__vinext/tests/fixtures/client-navigation-page.tsx
Nathan Nguyen fa1392616d fix(pages-router): preserve i18n client root navigation (#1323)
* fix(pages-router): preserve i18n client root navigation

Pages Router client navigation fetched the unprefixed root URL even when the transition resolved to the default locale. That let root Accept-Language detection redirect a link click from /new to the preferred locale path, diverging from Next.js.

Use the active locale for implicit Link and Router transitions, fetch default-locale root HTML through a locale-qualified internal URL while preserving the visible unprefixed URL, and parse i18n __NEXT_DATA__ scripts that append locale globals.

* fix(pages-router): preserve i18n client root navigation

Pages Router client navigation fetched the unprefixed root URL even when the transition resolved to the default locale. That let root Accept-Language detection redirect a link click from /new to the preferred locale path, diverging from Next.js.

Use the active locale for implicit Link and Router transitions, fetch default-locale root HTML through a locale-qualified internal URL while preserving the visible unprefixed URL, and parse i18n __NEXT_DATA__ scripts that append locale globals.

* fix(pages-router): validate next data parsing

* fix(pages-router): preserve link locale transitions

* fix(pages-router): preserve popstate locale fetch

* chore(pages-router): address locale review nits
2026-05-20 10:40:58 +01:00

6 lines
149 B
TypeScript

import React from "react";
export default function ClientNavigationPage() {
return React.createElement("main", null, "client navigation page");
}