mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This moves the locale redirect handling out of `base-server` as it shouldn't be handled here and should be at the routing level. This avoids the duplicate handling with middleware that causes the incorrect detection/infinite looping. Test case from separate PR was carried over to prevent regression. Fixes: https://github.com/vercel/next.js/issues/55648 Closes: https://github.com/vercel/next.js/pull/62435 Closes: NEXT-2627 Closes: NEXT-2628 --------- Co-authored-by: Nourman Hajar <[email protected]> Co-authored-by: samcx <[email protected]>
22 lines
367 B
JavaScript
22 lines
367 B
JavaScript
import Link from 'next/link'
|
|
|
|
export const getServerSideProps = async ({ locale }) => {
|
|
return {
|
|
props: {
|
|
locale,
|
|
},
|
|
}
|
|
}
|
|
|
|
export default function Home({ locale }) {
|
|
return (
|
|
<div>
|
|
<div id="index">Index</div>
|
|
<div id="current-locale">{locale}</div>
|
|
<Link href="/new" id="to-new">
|
|
To new
|
|
</Link>
|
|
</div>
|
|
)
|
|
}
|