Files
f260328900 BREAKING CHANGE: Enable newNextLinkBehavior (#41459)
- Enable newNextLinkBehavior. See #36436 
- Run next/link codemod on test suite

Note that from when this lands on apps trying canary will need to run
the new-link codemod in order to upgrade.
Ideally we have to detect `<a>` while rendering the new link and warn
for it.

Co-authored-by: Steven <[email protected]>
2022-10-17 21:20:28 -04:00

42 lines
1002 B
JavaScript

import Link from 'next/link'
export default function Main({ message }) {
return (
<div>
<h1 className="title">Hello {message}</h1>
<ul>
<li>
<Link href="/stream-response">Stream a response</Link>
</li>
<li>
<Link
href="/rewrite-me-to-about?message=refreshed"
id="link-with-rewritten-url"
className={message}
>
Rewrite me to about
</Link>
</li>
<li>
<Link href="/rewrite-me-to-vercel">Rewrite me to Vercel</Link>
</li>
<li>
<Link href="/redirect-me-to-about">redirect me to about</Link>
</li>
<li>
<Link
href="/dynamic-routes/hello-world"
id="go-to-hello-world-anchor"
>
Hello World
</Link>
</li>
</ul>
</div>
)
}
export const getServerSideProps = ({ query }) => ({
props: { message: query.message || 'World' },
})